rudolf97
rudolf97

Reputation: 121

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?

Upvotes: 0

Views: 87

Answers (1)

arkascha
arkascha

Reputation: 42925

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.

Upvotes: 1

Related Questions