开发者

how to upload files to PHP server with use of Python?

开发者 https://www.devze.com 2023-03-07 18:39 出处:网络
I was wondering is there any tutorial out there that can teach you how to push multiple files from 开发者_StackOverflowdesktop to a PHP based web server with use of Python application?

I was wondering is there any tutorial out there that can teach you how to push multiple files from 开发者_StackOverflowdesktop to a PHP based web server with use of Python application?

Edited

I am going to be writing this so I am wondering in general what would be the best method to push files from my desktop to web server. As read from some responses about FTP so I will look into that (no sFTP support sadly) so just old plain FTP, or my other option is to push the data and have PHP read the data thats being send to it pretty much like Action Script + Flash file unloader I made which pushes the files to the server and they are then fetched by PHP and it goes on from that point on.


I'm assuming you own the PHP server.

  • Use FTP. See here and here.
  • Make a file upload form with PHP, and use python to fill out the form. See this and this.
  • (Usually a bad idea) Use PHP to write small server that listens for data and then writes it to a file.


I think you're referring to a application made in php running on some website in which case thats just normal HTTP stuff. So just look at what name the file field has on the html form generated by that php script and then do a normal post. (urllib2 or whatever you use)

0

精彩评论

暂无评论...
验证码 换一张
取 消