Forum: 

lamp: tring to use web page to upload a file and dir is locked cant upload...

Jeremy Selph's picture

I have tested a web page on both lamp and on my windows machine with xampp and this is just a basic web page that will take a file and upload it to the directory. On lamp it dosent work..

Is there something I have to do with the webmin to allow for file uploads via a webpage?

I looked all over apache and in th ssh and I cant find anything..

I have done some configuration I wonder if I deleted something..

please help.

Jeremy Davis's picture

I have noticed some similar behaviour and have found a workaround (that worked for me at least).

Using Webmin - navigate to Tools>File Manager. Assuming that the dir that your webpage uploads to has no other files (if it does make a 'public' subdirectory). Click the dir in the right pane. click Info button (top row). Adjust the permissions to 0777 and "This folder and its files" (from the "Apply changes to" dropdown).

I know this is not ideal but it solved my problems. I'm not sure why this is a problem, perhaps it is to do with the hardened nature of the Turnkey LAMP?
Jeremy Selph's picture

I just had to apply the chnages to its dir and files, but it did work thank you..
Alon Swartz's picture

The php code is running under the webserver context (www-data), so it needs to have write access to the folder you want to save files to, for example:
chown www-data:www-data /var/www/uploads
Jeremy Davis's picture

Thanks for that, sounds like that should do the trick. [edit] That worked beautifully, thanks.

Post new comment