<p>Is it possible to upload a file from a client's computer to the server through a web service? The client can be running anything from a native desktop app to a thin ajax client.</p>

[{'answer_id': 14478, 'author': 'accreativos', 'author_id': 1713, 'author_profile': 'https://Stackoverflow.com/users/1713', 'pm_score': 0, 'selected': False, 'text': '<p>I\'m not a master in "webservice", but if you develop the webservice (and the client), you always can convert the binary file to <a href="http://en.wikipedia.org/wiki/Base64" rel="nofollow noreferrer">BASE64</a> in the client (can do in java... and i soupose in ajax too) and transfer as "string", in the other side, in the webservice encode to binary from BASE64...</p>\n\n<p>It\'s one idea, that\'s work, but maybe not "correct" in all enviroment.</p>\n'}, {'answer_id': 14482, 'author': 'Greg Hewgill', 'author_id': 893, 'author_profile': 'https://Stackoverflow.com/users/893', 'pm_score': 1, 'selected': False, 'text': '<p>It\'s certainly possible to send binary files via web services (eg. SOAP), but you usually have to do some kind of encoding such as base64, which increases the amount of data to send. One of the most efficient ways to send an arbitrary binary file is via an HTTP PUT operation, since there is no encoding overhead. Not all clients necessarily have an easy way to do this, but it\'s worth looking.</p>\n\n<p>The other side of that coin is how to get the data off the user\'s disk an on to the network connection. A "thin ajax client" might not have the requisite permissions to read files from the user\'s disk. On the other hand, a desktop app implementation would be able to do so without any problem.</p>\n'}]
['https://Stackoverflow.com/questions/11782', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/831/']