need help with this
Let me try to summarize.
If you do not know server side programming, and you just want network.upload() to magically upload data to an arbitrary web server, then network.upload() isn’t going to do what you expect and it never will.
There are too many different ways that a server side programmer could program their upload service that we could never ever have a chance of hitting the needs of your service’s unique methods. There just are no standards there. There are standards on now to talk to a web server, which our network.* API calls do immaculately.
It’s your responsibility to either understand web server-side programming well enough that you can make them talk together, or if you’re using someone else’s server, for them to tell you explicitly what data and headers you need to send and in what format. We just can’t predict that. I’m 100% confident with the changes that Networking 2.0 brought in, that you should be able to get network.request() to upload files to most any web server if you know what the expectations are. We just can’t guess what those expectations will be.
Now that said, there are some PHP methods of uploading files that don’t take a ton of experience to make work. The problem is, the most common one, something that uses the “multipart/form-encoded” method does not work with network.upload(). It works great with network.request(). The network.upload() is a simple helper method for network.request() to try and simplify the call a bit. There is a method using HTTP PUT and on the PHP side, reading the data from STDIN (the file: “php://input”) that network.upload() will work with. Most of the PHP scripts out there need some help figuring out where to save the data too, how to pick up the filename, and you have to know if you’re base64 encoding the data or not.
Where this is left with Engineering is that it would be nice if network.upload() would work with multipart/form-encoded form methodology (like I said, network.request() works today). That will take engineering time to make happen and we want to happen at some point. Because you can make this work today using network.request(), and the Engineering schedule is quite full, it’s unlikely to get time in the near future.
Uploading files isn’t trivial. I wish it were. If this is something your app needs and you’re in control of your own web services, I would recommend learning more about network/web service programming, perhaps in PHP and proceed that way. If you’re wanting to use a service you are not in control in, you need to contact that service and ask them exactly what they need for you to upload a file (HTTP headers and body content and if the data needs to be encoded) and proceed for there.
If you don’t know anything about computer programming but are using a user-friendly hosting service like GoDaddy or something, I might’ve found a solution for you. I personally am way too stupid to figure out that MultipartForm stuff.