#π Uploading files to nginx
33 messages Β· Page 1 of 1 (latest)
@plush pebble
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
With Python?
nginx != python
The Upload module handles file uploads using multipart/form-data encoding (RFC 1867).
Yes
Will try
Is python on the client or server?
Everythings running off my vm, just need to upload from results folder once my bot sends the signal that its done generating
So with a python script uploading the files, you would probably use the requests module.
Ok, Its using python to generate the mp4 then in the final video file it sends a print
ex: ```py
import requests
requests.post("https://example.com/upload", files={
"file1": ("filename.txt", b"file contents goes here")
})
How would I setup the part so my domain would have that?
would this tell me?
you can use an ip
but if I send the user there video file link wouldnt it be the ip and not a domain?
"http://10.0.0.1/upload"
So what url would the file be saved to?
"http://10.0.0.1/filename"?
upload is the endpoint. You specify the filename in the files argument.
The filename in this is filename.txt
yes but how would you download it?
I need a shareable link that people can download the file from that link
you'd have to add the upload folder as a static folder in nginx
You may consider making a flask endpoint for it instead of using nginx
On the server side I think you will need to write a little Python WSGI application. You can't just "upload" a file to a web server -- something on the server has to catch the HTTP requests and store them as a file.
Read up on Python Flask applications. You need one on the server side.
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.