Streaming client files to blobs in database on server

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Streaming client files to blobs in database on server

Postby bevil » Sun Mar 24, 2019 12:58 pm

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
bevil
 
Posts: 163
Joined: Thu Oct 18, 2012 7:31 pm

Re: Streaming client files to blobs in database on server

Postby bevil » Sun Mar 24, 2019 4:20 pm

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
bevil
 
Posts: 163
Joined: Thu Oct 18, 2012 7:31 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 11 guests