Client Command "readfile"

Paul Mulroney pmulroney at logicaldevelopments.com.au
Mon Apr 25 06:33:55 UTC 2022


Hi Das,

I've not used the readfile client command, but we have used the file control component to upload/download files to/from the browser to the server.

Reading the docs, it seems that the readfile client command should be called in response to an evDrop event - if you drag a file from the file system onto a jsClient component, you will get an evDrop event in the object's $event.  If the pDragType is kDragFiles, then you know it's a file being dropped.

Then you do $cinst.$clientcommand('readfile',lrow) to trigger the transfer to the server
Then the top level form will get a $filereadcomplete message.

The $filereadcomplete method has two parameters - ident and errortext.  If it didn't upload properly, the errortext parameter should have some info in it.

It seems a little fiddly to setup, but hopefully this helps!

Regards,
Paul.


> On 24 Apr 2022, at 3:50 am, Das Goravani <goravanis at gmail.com> wrote:
> 
> 
> I have a client command that I’m sending. It’s the "readfile" type. It is supposed to run $filereadcomplete after it reads in the file.
> I have a "Sound bell" in that $filereadcomplete method, and I’m not hearing any bells.
> 
> I am issuing the client command from an $event of a list on the form.
> 
> This is my client command:
> 
> Calculate lrow as row(iIdent,'iBinData',kTrue)
> Do $cinst.$clientcommand("readfile",lrow) Returns #F
> 
> iIdent is the ident that the drop gives.
> iBinData is the name of the field I want it read into.
> kTrue just says I want base64
> 
> $filereadcomplete is a built in method that I overrode to make it a client executed method I could put code in. 
> 
> There I have sound bell and a little bit of code
> 
> The net result is not happening. The base64 is not appearing. I know I can’t trust the bell on client executed methods with Safari. So I’m not trusting it. 
> 
> The other way I check is did the base64 make it into my list and no it is not. 
> 
> So something isn’t working. 
> 
> Any ideas?
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 




  <https://www.logicaldevelopments.com.au/>	Paul W Mulroney
Logical Developments
Customised Software Solutions
Ph: 08 9458 3889
 	We Don't Do Simple Pty Ltd
trading as
Logical Developments
ACN 161 009 374
 	  <https://www.facebook.com/logicaldevelopmentswa/>   <https://twitter.com/WeDontDoSimple>   <https://www.linkedin.com/company/logicaldevelopments/>   <https://www.youtube.com/channel/UCPldVVgWR05WX3cVrR5WUQw>


More information about the omnisdev-en mailing list