I have problems with files uploading. The script mentioned in this topic doesn't work, since no CONTENT_LENGTH (or CONTENT_TYPE) environment variable is set (I checked it). BTW, I used the upload.html code to perform all tests.
I tried to just read the stdin, but it doesn't work. My CGI scripts (pure newLISP) get nothing to read (stdin is empty).
When I tried to reach the newLISP HTTP server directly (without nginx serving as a proxy), I was able to upload a text file. I just used a simple script, that reads stdin, and gets all the content of the sent file:
Code: Select all
(set 'infile (open "upload-file" "write"))
(while (read (device) buffer 1024)
(write infile buffer))
(close infile)
Code: Select all
-----------------------------1124875958105779246987104586
Content-Disposition: form-data; name="uploaded_data"; filename="polsl.gif"
Content-Type: image/gif
GIF89a_
Now, the questions.
1) Why on earth my script doesn't get anything on stdin when newLISP HTTP server is run behind a proxy (nginx in my case)?
2) Why on earth binary files aren't properly sent, while text files are?
I'll appreciate any help.