lighttpd 1.4.19 on Ubuntu: http file uploads fail
I am trying to import a compressed exported database into phpmyadmin. This is what /var/log/lightty/access.log has:
71.170.222.197 - - [25/Sep/2008:16:56:02 -0400] "POST /phpmyadmin/import.php HTTP/1.1" 413 0 "
This is what /var/log/lighttpd/error.log has.
2008-09-25 16:56:01: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-Hu0l6j No such file or directory
2008-09-25 16:56:02: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-jjFSNv No such file or directory
2008-09-25 16:56:02: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-NbEhtS No such file or directory
2008-09-25 16:56:02: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-zxv3Gq No such file or directory
2008-09-25 16:56:02: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-HG2Qx7 No such file or directory
The file size of the is 4,164KB. I wrote a small php script (to upload files) to help "debug" this problem. Upload only worked with small text files.
Any help is appreciated. I getting very tempted to switch to Debian.
11 Replies
The problem was the uploads directory did not exist in /var/cache/lighttpd/. Doing
mkdir /var/cache/lighttpd/uploads
chowm -R www-data:www-data /var/cache/lighttpd/uploads/
has seemed to fix the problem. I just don't get why the uploads subdir wasn't automatically created by lighttpd?
Anyway, the replies are much appreciated.
@kurtk:
But something must be amiss in the installation because an upload directory will always be needed by a http server because file upload forms are part of http.
Nope.
The PUT method (to replace a URL) is defined by the HTTP 1.1, but most servers don't support it at all (except to deny it). The POST method sends an entity to the server, but how that entity is processed is determined by the URL: could be a file upload, could be a form values, could be a Python script to run, could be ignored completely: all equally valid and all completely outside the scope of HTTP.
Forms are part of HTML, and the INPUT type 'file' is intended for uploads, but there's no requirement that the server accept such uploads, nor should there be (remember: I can send arbitrary requests to your server, regardless of what forms you may or may not present me.) As someone who has run many servers that didn't accept file uploads, I'd be pretty unhappy with an HTTP daemon that enabled them automatically.
uploadtmpdir="/home/lighttpd/uploads"
Set the directory's group to www-data and gave it rw permissions. I had php process a http file form. It worked fine.
Thanks for info.
HTTP is a communication protocol. HTML is a way of expressing the layout and content of a document for interpretation by a browser.
@SteveG:
@kurtk:But something must be amiss in the installation because an upload directory will always be needed by a http server because file upload forms are part of http.
Nope.The PUT method (to replace a URL) is defined by the HTTP 1.1, but most servers don't support it at all (except to deny it). The POST method sends an entity to the server, but how that entity is processed is determined by the URL: could be a file upload, could be a form values, could be a Python script to run, could be ignored completely: all equally valid and all completely outside the scope of HTTP.
Forms are part of HTML, and the INPUT type 'file' is intended for uploads, but there's no requirement that the server accept such uploads, nor should there be (remember: I can send arbitrary requests to your server, regardless of what forms you may or may not present me.) As someone who has run many servers that didn't accept file uploads, I'd be pretty unhappy with an HTTP daemon that enabled them automatically.
@kurtk:
I had php process a http file form.