Transferring file

JDS

Active Member
Licensed User
Longtime User
We need to transfer a image to an webservice.
B4X:
Soap.PostString(Main.ASPUrl&"Status.asp", "pd="& Main.uniqueID & "&pw=" & Main.wachtwoord & "&px=" &sParameter)

sParameter is an XML-file encrypted with base64. The above code works... without the image.

The XML-file should also include the image. If we encrypt an image (240x139 px) and add this to the XML-file (sParameter) the asp-url becomes more than 2000 chars which isn't supported by the browsers.

Any thoughts how to transfer the XML-file? Or how to shrink the size of the url?
 

JDS

Active Member
Licensed User
Longtime User
What should the server-side look like if we use a postfile?

We first send the large XML-file, which get saved on disk and then we send the initiator which opens and processes the file.

Does the postfile send the file as a byte array?

Any help would be great...
 
Upvote 0

abner69

Member
Licensed User
Longtime User
why not encrypt the name of the file to send into your xml file, and then upload the file seperately using httputils2?

The server side can then take care of the "housekeeping" needed...

...Pablo
 
Upvote 0

JDS

Active Member
Licensed User
Longtime User
Hi Pablo,
That was exaclty what I suggested in my second post. But we have no idea what the serverside lookslike for a postfile.

ASP is a url with parameters. If we read the image as a byte array and then make it base64 the url gets to long because of the long base64 string (2000+ chars).

Our PHP-knowledge is limited but what i've read this also works with a url. Which gives the same problem.

What other options do we have?
 
Upvote 0
Top