I have looked through the site and have tried everything I can find with no luck. Any help would be appreciated.
I have a form to add or update information into a database and to add/update a PDF file. I have tried everything I can think of to move this file from the $_FILES['brochure']['tmp_name'] to a new directory with a new name. I have even tried to keep the name the same in the new directory and cannot get it to write the new file.
I have tried:
move_uploaded_file($brochure_path, $pathtosave)
move_uploaded_file($_FILES['brochure']['tmp_name'], $pathtosave)
copy $brochure_path $pathtosave
and
exec(cp $brochure_path $pathtosave)
Nothing seems to work. I have no errors on the $_FILES['brochure']['error']
I have echoed the $brochure_path and $pathtosave and they are fine
I have even tried fcopy, fread, fwrite and it will read but not write. I am told the permissions on the server should allow me to copy this file. I even changed permission on the directory with no luck. I am starting to doubt that it should work and think there may be a server setting or permission that is keeping me from copying the file. I cannot get any error message to point me in the right direction. In fact there are no error messages that I can see. Any ideas what to try next?
Second if I can't copy the file is there anything special I need to do to put the data in the database and display it correctly? I can get it in the database and have worked out the headers so it launches the Adobe Plugin but it says the file is corrupt. The same script worked for images. Again any help would be appreciated and thank you in advance.