开发者

Save File to a remote Url

开发者 https://www.devze.com 2023-04-07 16:05 出处:网络
first of all sorry for my english , not my main lang. I need to export some data to a remote folder from android.

first of all sorry for my english , not my main lang.

I need to export some data to a remote folder from android.

I have a file on android "file.xml" and开发者_运维问答 i need to export it to a folder (under iis) "http://192.168.x.xx/folder/fileuploaded.txt"

It seems most of the examples out there are using an upload script in php, but i need to do it only from android. Doing the opposite way (from remote url to android app) is easy with Url.openStream(), but i cannot find a working example to put back the file on the server.

Maybe im missing something, this is my first android (and java btw) app.

anyone could point me in the right direction?

Thanks!


Diego, what you are trying to achieve is not possible only from Android. You cannot put a file on the server using HTTP unless there is a receiving application running.

You can only post your binary data to the server (url) but to write it locally and make it available on the http again for download, can only be done if you have a server app. It could be created using any language PHP, JSP, ASP etc.


You cannot just upload files to server of your wish unless there is something on the server side that allows file uploads. That is usually a ASP/Perl/PHP script.

If you don't want to use such a script, then one way to do this is to run ftp on your server and upload files using that.

0

精彩评论

暂无评论...
验证码 换一张
取 消