Page 1 of 1

Streaming client files to blobs in database on server

PostPosted: Sun Mar 24, 2019 12:58 pm
by bevil
I need to be able to stream a file from a smart client local filesystem (Mac or windows) to a blob on the server.

I am aware of streamfilestoserver, but that seems to only stream a file to the filesystem of the server.

I previously used the IT2BE streaming plugin, and when that stopped working, moved to the UsermanagerPro plugin, but that has stopped working too (code signing issue on new Servoy installs). Patrick says that he was going to deprecate that function anyway because the functions can be found in Servoy. However it doesn't seem to allow the streaming of files to a blob.

I could move away from blobs if that is simply something that Servoy no longer allows, however that would mean all existing solutions which have files as blobs would have to have that exported and re-implemented in the file system, which is quite a lot of work.

Any ideas would be gratefully received. :)

Bevil

Re: Streaming client files to blobs in database on server

PostPosted: Sun Mar 24, 2019 4:20 pm
by bevil
I have now made this work by doing this:

Code: Select all
   var file = plugins.file.showFileOpenDialog(1, null, false, null, null, 'Choose a file to transfer');
   if (file) {
      var vmynewimage = foundset.getRecord(foundset.newRecord())
      vmynewimage.import_from_file = file
      vmynewimage.image_blob = file.getBytes()
      vmynewimage.image_thumb = file.getBytes()
}
      



Not sure if that is going to have a performance impact on the client though. Should I stream the file to the server first