I need to know what to use for the destination path for the move function move_uploaded_file. (see http://php.net/manual/en/function.move-uploaded-file.php )
Now I have a code that works fine. My domain root directory contains the following elements (among others):
uploads <is the add-photo-submit.php folder <-this is a PHP file that uses move_uploaded_file
In add-photo-submit.php, I have the following line of code:
$target_path = "uploads/" . basename($_FILES['uploadedFile']['name']);
$ target_path is used as the destination parameter for the function. This works fine when I access the file through www.mydomain.com/add-photo-submit.php
However, I recently modified the .htaccess file to remove .php and add trailing slash. Now the PHP file is available at: www.mydomain.com/add-photo-submit/ I think the PHP file interprets the target path as "www.mydomain.com/add-photo-submit/uploads/filename.jpg"
I tried using the absolute path, but he said that I do not have permission ...
In the future, I would like to configure my root directory as follows: root
-admin (folder)
-add-photo-submit.php
-uploads
Which link system has move_uploaded_file?
source
share