file upload | developer.brewmp.com file upload | developer.brewmp.com

Developer

file upload

Forums:

hi all,

In my application, i want to upload a file that is present on my phone to the server. the file is a jpeg image file.

I am trying to send the file contents with http post request body.
so to get the contents of the image file. I open and read the jpeg image with the IFile and IFileMgr interface. I read 1 byte at a time till i get the end of file.

but after whole file is read, the contents of the file and contents of the buffer in which the file is read do not match.

i wanted to know, if there is any other way by which the file can be uploaded to the server? or any other way to get the contents of the jpeg file?

this is really urgent. pls help.

Thanks in advance.
Pribhi.

If you want to upload file you should use multipart format according by RFC 2616.
1st send header include boundary meta length... etc. parameter to server
2nd send body and boundary to server
3rd if file end then finished symbol else repeat the 2nd to sever
Now you can upload file.
BR!
Kenson

If you want to upload file you should use multipart format according by RFC 2616.
1st send header include boundary meta length... etc. parameter to server
2nd send body and boundary to server
3rd if file end then finished symbol else repeat the 2nd to sever
Now you can upload file.
BR!
Kenson

i am not being able to get the contents from the file to be uploaded..
can u pls tell how to separate the headers and other contents from the image file.
Thanks
Pribhi.

i am not being able to get the contents from the file to be uploaded..
can u pls tell how to separate the headers and other contents from the image file.
Thanks
Pribhi.

The header not be in the image file. It is arranged by yourself according to RFC 2616 network upload protocol which is similar with download file from server that first of all get the request's the header and then get the file data.
The upload file contrarily with download file from net server.
BR!
Kenson

The header not be in the image file. It is arranged by yourself according to RFC 2616 network upload protocol which is similar with download file from server that first of all get the request's the header and then get the file data.
The upload file contrarily with download file from net server.
BR!
Kenson