File uploading via URL

Nod

Honorary Master
Joined
Jul 22, 2005
Messages
10,968
Reaction score
2,715
Location
Darling
I'm trying to upload a file by specifying it in the URL directly:
http://myserver/index.php?filename=c:\temp\text.txt

How can I go about doing this? I have tried a onload form submit, but this seems to go into a loop.

I wrote a application that takes an uploaded csv file, and then compares values against a reference database. Now, there are a request to upload files directly via another application.
 
I don't really think that's possible. AFAIK you have to "post" the file to the server by using the file-browse-control thingy. Just specifying a url as a parameter would necessitate the server to contact the client to transfer the file from the specified url... There might be a solution for this, but it's not really dawning on me right now.
 
I'm trying to upload a file by specifying it in the URL directly:
http://myserver/index.php?filename=c:\temp\text.txt

How can I go about doing this? I have tried a onload form submit, but this seems to go into a loop.

I wrote a application that takes an uploaded csv file, and then compares values against a reference database. Now, there are a request to upload files directly via another application.

You cannot upload a file by specifying its local path on a client machine in a GET request to the server.

What happens in a normal file upload using a form and a POST request is that the user agent (client side) reads the file locally and encodes it in the multipart/form-data encoding and embeds the newly encoded data in the POST request. This is all done transparently to the user. It is then the server's responsibility to decode the file and save it somewhere.

For your requirements as stated above, it might be easiest to use a HTTP library to encode the file and make the HTTP POST request to your service from the other application. Most languages will have suitable HTTP libraries.
 
Yeah, I thought it might be slightly difficult, so have asked for a list of interfaces to this application. Hopefully that will work, otherwise I'll have to share a input folder where the application can export to.
 
Top
Sign up to the MyBroadband newsletter
X