简体   繁体   中英

Uploading files without form?

I wanna make my own little renderfarm-backend building on php and mysql. I have a huge plan for doing everything but there is one problem. How can I upload an image without a form?

Three alternatives:

  1. you make exactly the POST request a browser would do when submitting an upload form, you do not need the form for that. It is a simple http POST. You can find countless examples for that here on SO or on google.

  2. take a look at webdav, an http extension that allows flexible file access via http. Might make sense if you want to integrate your uploading into something like a local file manager or the like.

  3. you use a file centered protocol for uploading, so implement the upload separate from the php stuff. sftp comes to mind here, but obviously you need to setup a separate server for that and map the file system locations as required. Also you have to take care of the file permissions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM