Python Forum
How can I upload some files to my website?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I upload some files to my website?
#1
Hello guys,

I'm currently saving some .csv files on my computer, but I would like to upload those .csv files to my website, is it possible to be done using Python?
Reply
#2
How do you normally upload stuff to your site? If you use FTP, for example, Python certainly has an FTP client in the standard library.
Reply
#3
(Mar-17-2021, 01:24 PM)ndc85430 Wrote: How do you normally upload stuff to your site? If you use FTP, for example, Python certainly has an FTP client in the standard library.

Yes, I normally do it using FTP.
let me try!
Reply
#4
You can use Requests for this.
A couple of examples.
import requests

response = requests.put('http://ftp://username:[email protected]/backup/')
import requests

headers = {'Content-Type': 'multipart/form-data',}
files = {
    'data': ('test.mp3', open('test.mp3', 'rb')),
}
response = requests.post('http://mysuperserver/media/upload/', headers=headers, files=files)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Upload Files to Azure Storage Container phillyfa 6 733 Dec-22-2023, 06:11 AM
Last Post: Pedroski55
  Making a question answering chatbot based on the files I upload into python. Joejones 1 1,262 May-19-2023, 03:09 PM
Last Post: deanhystad
  Upload files to Google/Azure/AWS or cloud drives using python tej7gandhi 0 1,926 May-11-2019, 03:02 PM
Last Post: tej7gandhi
  upload Files to FTP and file name is Chinese mollychen 2 2,625 Apr-15-2019, 01:01 AM
Last Post: mollychen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020