Uploads Body not populating properly (wodSFTP / wodSFTP.NET / wodSFTPdll)
I think I have noticed a bug (I think this was fixed in a previous version).
When I upload a file in my browser to an instance of wodWebD.dll (v1.2.4 - latest) I expect to find the Uploads(x).Body populated with the file contents (I then am saving it to a BLOB in a DB). However, I get garbage instead. The amount depends on the size of the file uploaded. After examining the other properties of Uploads(s). I can see the correct attributes for the file. For example, the 'Begin' and 'End' properties correctly total out to the file size. However, when I copy the contents of 'Body' into another variable (I am copying to an ADODB.Stream, but get the same result with a standard string variable) I get a much, much smaller amount of data, that appears to be garbage. For example:
a file of size 3,774,631
Uploads().Begin=269
End=3774900
Copied string=12178 <---- not copying all the data
Is this a bug? If I use the '.Save' method it DOES correctly save to a file - but I do not want this, I want to copy the '.Body' value directly into a database.
Thanks for your help
Re: Uploads Body not populating properly
Hi D,
Could you please prepare a small sample which would duplicate that behaviour so we could run it over on our side and duplicate the issue?
If yes, please send it to techsupport@weonlydo.com
If we can duplicate, and it is a bug, we will try to find some kind of solution.
Regards,
Damba
Re: Uploads Body not populating properly
E-mail sent with sample project - let me know.
Re: Uploads Body not populating properly
Dave,
this works from what I see. In your spcific sample, which Uploads(XYZ).Body should we check- what is XYZ?
I assume you refer to Request.Uploads(1).Body to be invalid. This is binary data, that's why Len(body) returns small number. But if you call Save method it will work ok.
What I could try to do is take care of binary data handling better - let me see about that.
Kreso
Re: Uploads Body not populating properly
Done. Request update.
Kreso
Re: Uploads Body not populating properly
Inital testing shows that fixed it - I will keep you apprised if I encounter something that proves otherwise - thanks for the quick response!