I would like to upload one file on server through android device. Once the file is uploaded on server it modifies it & sent back to client.
Can you please help how to achieve it through volley in request I have to upload the file & in response am getting a file after applying some modification on uploaded file. After getting the file in response need to save it in mobile device.
Got one example from Github in which a file was uploaded on server through SimpleMultiPartRequest class but in response was getting string response. In my case am getting status as success or failure along with the modified file.
Related
I am facing an issue with trying to download a file from the server in the cordova android app...In the cordova app we are using the inappbrowser to open a web application in html and JS. When we try to do window.open("url","_blank") we are unable to get the file to be downloaded.
From the server we are getting
Content-Disposition: attachment; filename="filename.jpg"
Still i am unable to get the files to get downloaded
Response headers have the content disposition set and the response seems to be empty with a content type text/file
One concern for us is that the cookies need to be sent alongside with the request and is set by the server after authentication, hence we cannot use the external browser (using _system)
Thanks
I'm trying to upload a jpeg image to my web server via an HTTP PUT method.
With Fiddler, I'm able to compose an HTTP PUT request, upload the image and execute the request successfully.
However, on Android, I can't get it to work. I've read many solutions about using MultipartEntity. When I try that, the image received on the server is corrupted. I compared the content of the original image with the one received by the server and I see that some HTTP headers are added at the beginning of the file and that the multipart boundary is added at the end, therefore corrupting it.
I've set up Fiddler on the web server as a reverse proxy to capture the incoming HTTP traffic:
here's the result
On the top, the HTTP PUT request sent with Fiddler that works.
At the bottom, the one sent by my Android application that sends a corrupted image.
How can I send an HTTP PUT request on Android that will produce a similar request than the one sent with Fiddler?
I was referred to this
link(Upload large file in Android without outofmemory error)
for send internal storage file to server After that i got error
internal server error code 500.In my previous app, it was working perfectly
Is this client side or my server side problem?
I am using file directory :-
File mydir = context.getDir("mydir",Context.MODE_PRIVATE);
This is a error which can be occur due to your mistake.I think you should also post your code with you question which would also help us to understand what you are doing and will easy to amplify your mistake. I am referring you to this link which explains more about server error (error code 500) here and check the timeout you are using in your code .
I am working on an android application, in which we are required to upload an encrypted file to a server using VPN network on a mobile device. I have the method to encrypt the file, but I have no information how to upload a particular file to a remote server. Kindly suggest me some method to upload a particular file to the server. Also suggest me how to calculate the upload time.
Thanks!
Try this code $upload_time = time() - $_SERVER['REQUEST_TIME'];.The result will be in seconds
My application downloads files using Android DownloadManager. If download is failed for some reason (for example file doesn't exists anymore) my server provides me with XML response containing problem description. But it seems that in ACTION_DOWNLOAD_COMPLETE receiver I can only get HTTP status code.
My question is: Can I actually somehow get XML server response (or just raw response) in ACTION_DOWNLOAD_COMPLETE receiver?
For now I can see only variant with sending extra request if download is failed.