Hi,
I have recently used showFileOpenDialog() method of file plugin. I deployed the application onto the servoy server and was testing it out, but couldn’t get the file dialog box to open. If I have servoy developer open, it does show the file dialog in the remote machine where the servoy developer is open.
Likewise, if I run Servoy webclient from servoy developer, it does seem to open the dialog box.
Thanks in advance.
Kind Regards,
Sunil
Hi Sunil,
you are right, it doesn’t ![Crying or Very sad :cry:]()
I had listed the file plugin as web compatible on my FAQ (http://www.servoy-stuff.net/faq.php) but I didn’t tested all the methods of all the plugins on all configuration: you find the missing spot for the file plugin…
Will update the FAQ with a note on this one.
Cheers,
Hi Patrick,
Thanks for you quick response.
If that’s the case, would you know any other ways we could do this in the web at the moment, ie, select a local file.
Thanks for your help.
Kind Regards,
Sunil
Hi sthapa2010!
To select a file on the web try this code inside an html area.
<html>
<body>
<input type='file'/>
</body>
</html>
Best regards. Roberto Blasco.
if this is to load files into a mediafield:
just place a media type dataprovider (i.e. my_media_field) on your form (type imagemedia)
In the webbrowser this will - by default - show buttons that’ll enable you to load/save/delete files into this field.
if you want to store the filename as well, just create a second dataprovider with the same name + _filename (so: my_media_field_filename)
Hope this helps…
The file plugin operates where the business logic of your client executes. For a WebClient/headless Client that is on the Application Server.
From a browser in general, there is no way to open a file select dialog directly. The only option is through an input field of type “file”.
Within Servoy, that would be a media field. So, if you want your user to be able to upload files, place a media field on your form. In the WebClient, it’ll show a couple of buttons to upload/download the file in the media field.
Paul
Thanks for all your responses.
While media field seems to be the obvious solution for file upload in the web, I am not sure whether it fits well with my problem in particular.
Let me elaborate a little. What I have been doing with the Servoy smart client is: select an excel file with about 1000 rows, use IT2BE Data Plugin to then import 1000 rows into three tables in MYSQL. This works perfectly well in the smart client but, in the web client, I just can’t select the file.
If I use media field, could you please tell me whether I can:
- temporarily store media file in global media field?
- How can I pass the media file from the media field as a source (of file type) into IT2BE’s data plugin’s excel function?
- How can I automatically save the excel file onto the server once it is uploaded into the media file?
- How can I download a server file onto client’s desktop?
Sorry for asking so many questions. It’s just that I have been going nowhere with these problems. ![Crying or Very sad :cry:]()
Thanks in advance.
Kind Regards,
Sunil.