php - set folder into directory -
I'm making an app to upload the file to the system but here, I'm facing a problem. The folder is properly created as I want, but when I click the upload button, the file is not saved in the folder as I have set it as a goal. Below is my syntax < Previous> Returns TRUE success or FALSE on failure. If you assign the $ id = $ _ session ['subject']; $ Target_path = mkdir ("doc_student / $ id", '0777'); $ Target_path = $ target_path basename ($ _ files ['uploadedFile'] ['name']); If (move_uploaded_file ($ _ files ['uploaded file'] ['tmp_name'], $ target_path)) {resonant "file" basename ($ _FILES ['uploaded file'] ['name']). "Uploaded"; } Else {echo "error while uploading this file"; }
$ target_path to the
mkdir function, then the variable gets boolean, try it,
$ target_path = "doc_student / $ Id "; If (! Is_dir ($ target_path)) {MKDIR ($ target_path, '0777'); } Instead of
$ target_path = mkdir ("doc_student / $ id", '0777');
Comments
Post a Comment