How to use a blob file with the HTTP addfile method?

I’ve been working on a method to POST a file to a remote webserver.

The method works correctly when selecting a test file, or hardcoding a file path in the method.

But, when trying to pull the file from the database - referring to the blob data field directly, using a blobloader url or using JSfile or Getimage methods - it will always fail and the poster.addfile method returns false.

This particular solution is still on 3.5.10. Plans to upgrade are coming, but need this feature now.

I’d like to not have to write to the users harddrive first (unless someone has some code for a handsfree and OS independent directory path).

I thought the blob loader would work:

var img_url = ‘media:///servoy_blobloader?servername=’ + controller.getServerName() + ‘&tablename=media&dataprovider=media_data&rowid=’ + media_id

var AddParam1 = poster.addFile(‘uploaded_file’,‘test.png’,img_url);

Is there really no way to “attach” a database file to an HTTP post via poster.addfile?

poster really wants a File on disk currently to stream

So if you have binary data from somewhere you have to create a temp file.

You can also create a case to support byte, urls or steams directly to post.

(P.S. i think it will by quite easy for patrick to implement ;)

jcompagner:
(P.S. i think it will by quite easy for patrick to implement ;)

Is that a hint or something? ;)

ptalbot:

jcompagner:
(P.S. i think it will by quite easy for patrick to implement ;)

Is that a hint or something? ;)

It sounded more like : “Make it so, number one” ;)