file-upload

Django file upload with FTP backend

Django file upload with FTP backend Question: I want to upload my files based on the example Need a minimal Django file upload example, however I want to store the files not locally, but on another server with the use of FTP. I have been trying to get this code to work, which looks simple …

Total answers: 3

Uploading and Downloading Files with Flask

Uploading and Downloading Files with Flask Question: I’m trying to write a really simply webapp with PythonAnywhere and Flask that has lets the user upload a text file, generates a csv file, then lets the user download the csv file. It doesn’t have to be fancy, it only has to work. I have already written …

Total answers: 2

How to upload file with python requests?

How to upload file with python requests? Question: I’m performing a simple task of uploading a file using Python requests library. I searched Stack Overflow and no one seemed to have the same problem, namely, that the file is not received by the server: import requests url=’http://nesssi.cacr.caltech.edu/cgi-bin/getmulticonedb_release2.cgi/post’ files={‘files’: open(‘file.txt’,’rb’)} values={‘upload_file’ : ‘file.txt’ , ‘DB’:’photcat’ , …

Total answers: 9

Uploading multiple files with Flask

Uploading multiple files with Flask Question: Is there a way to receive multiple uploaded files with Flask? I’ve tried the following: <form method=”POST” enctype=”multipart/form-data” action=”/upload”> <input type=”file” name=”file[]” multiple=””> <input type=”submit” value=”add”> </form> And then printed the contents of request.files[‘file’]: @app.route(‘/upload’, methods=[‘POST’]) def upload(): if not _upload_dir: raise ValueError(‘Uploads are disabled.’) uploaded_file = flask.request.files[‘file’] print …

Total answers: 4

How to upload file ( picture ) with selenium, python

How to upload file ( picture ) with selenium, python Question: How to upload a picture on a web application with the selenium testing tool? I am using python. I tried many things, but nothing worked. Asked By: Filip || Source Answers: Upload input control opens a native dialog (it is done by browser) so …

Total answers: 19

How to copy InMemoryUploadedFile object to disk

How to copy InMemoryUploadedFile object to disk Question: I am trying to catch a file sent with form and perform some operations on it before it will be saved. So I need to create a copy of this file in temp directory, but I don’t know how to reach it. Shutil’s functions fail to copy …

Total answers: 5