Forum Moderators: coopster

Message Too Old, No Replies

PHP File Upload Temp Dir

         

SeanF

2:12 pm on Mar 29, 2020 (gmt 0)

5+ Year Member Top Contributors Of The Month



Hi:

I have an application (PHP/MySQL) which includes a function that allows users to upload files.

The code has not changed for about two years and now the upload function is failing. If I echo the error, it's "8 - Missing a temporary folder." Similarly, I have not changed the folder structure or the php.ini file. (currently the upload_tmp_dir is not set in php.ini) My hosting company is becoming more and more unreliable and I would not be surprised if they make changes which would affect this without notifying their customers.

To mitigate changes I may not have control over, is there a way I can explicitly declare an upload temp directory within the php code?

Thanks

JayDub

4:28 pm on Mar 29, 2020 (gmt 0)

5+ Year Member Top Contributors Of The Month



You should be able to do that within the script itself rather than in the ini file. Look for file_put_contents(), fwrite() or fputs() in the script handling the uploading for the path it's using.

SeanF

5:03 pm on Mar 29, 2020 (gmt 0)

5+ Year Member Top Contributors Of The Month



Thanks!