cancel
Showing results for 
Search instead for 
Did you mean: 

PHP uploading file through form under Plesk

thiswayup
Newbie
Posts: 2
Registered: ‎24-04-2009

PHP uploading file through form under Plesk

Hi there everyone, home somebody can shed some light on this.
I have a page which is intended to allow the upload of an image file into a database.  The file is transmitted to the server using the usual http method (POST a form).  This used to work fine on my ccgi account, but I have just realised that it doesn't work on the plesk platform.  A quick bit of troubleshooting tells me that the file is being uploaded to the server successfully, but I think the php can't find the file in it's temporary area, so it doesn't know where to find it to start processing it for the database insert.
Is this method of upload possible on Plesk?  Where do files go when they are uploaded through POST requests?
Hope someone has come across this already, and not been confounded!

Thanks
Sandy Noble
3 REPLIES 3
gordo
Grafter
Posts: 71
Registered: ‎05-08-2007

Re: PHP uploading file through form under Plesk

I have a geneology programme running on the same server, and have very little trouble uploading Photos and files using the upload feature of the programe which is in php.  would need a few more details of the file name and perhaps a copy so I can perhaps try it out.
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: PHP uploading file through form under Plesk

Hi Sandy,
Yes, you can POST files to PAYH. POSTed files are stored under a temporary filename in /tmp and then moved to one of your own folders using something like

move_uploaded_file($_FILES['myfile']['tmp_name'], basename($_FILES['myfile']['name']))

Just a guess, but you might run into difficulties if the folder to which you're trying to move the file is not writable by Apache. Try setting the relevant folder permissions to 777.
Gabe
thiswayup
Newbie
Posts: 2
Registered: ‎24-04-2009

Re: PHP uploading file through form under Plesk

Thanks for the confirmation guys, I am reassured.  I did think it must be a permissions problem, but I didn't really know which folder I should be changing the properties on.  I'll give this a shot on the weekend, and see what happens!

Cheers
Sandy