Can anyone show me some example code of uploading a file using a web service?
For the moment it is a text file.
amazon s3 do this i believe
Thank you for your replay, I had a look at it. They are submitting the form as following:
Now I know that this works but the point is that I basically don't have a web server, just web services. So instead of submitting a form I read the data, wrap it into a soap message and issue a web service call. I can add web services at will but I want to avoid having to program on the web server (the web service communicates with an application server).
So I guess what I need to do is to find out how to read the CONTENTS of the file into a variable so I can submit the data to the web service.
hi firstly that the form on my site you looked at, lol
amazon s3 webservice is here http://www.amazon.com/S3-AWS-home-page-Money/b?ie=UTF8&node=16427261
i havent looked into it myself yet, as we use secure ftp to transfer files in background, i imagine the overhead for a webservice would be massive
but i presume the binarry data could be base64 encoded (or something similar) into the SOAP responce?
anyways i found thse, could be usefull, u got me interested now
I guess he was trying to ask whether he can use Ajax to upload file to other web service provided by a site from different domain
Surely I am working on an Ajax application and I communicate with my own application server thru web services. So I am in control of both sides.
First let met tackle a simple text file (which is the case at hand now) and later I suppose I will want to add base64 encoding for binary files.
I tried the following which is exactly what I want, but unfortunately I get access denied in both IE and Firefox:
var myRequest = new XMLHttpRequest;
var myText = myRequest.responseText;
you cannot get local file with "file:" protocol. It violates the rule to protect users' security
So back to the drawing board. Any takers?
OK I understand that and it makes sense (although the form method has access to local files as well but that aside).
well if you going to go to the whole bother of uplaoding to the server why dont you let the server send the file as a webservice then? instead of sending it back
Well, it depends what it does first
Well it seems I cannot stay away from PHP on the web server to solve the upload problem.
I am going to look into uploading the file to a PHP program on the server that copies it to my target server directory for subsequent processing by my normal application server through a web service command.
Thanks for the help.
This topic is now closed. New replies are no longer allowed.