file plugin in web client

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

file plugin in web client

Postby Roberto Blasco » Wed Jun 23, 2010 12:42 pm

Hi all!

Does the file plugin methods works in web-client?

i.e.

Code: Select all
controller.newRecord();
blob_field = plugins.file.readFile(client_file_path);
databaseManager.saveData();


it works in developer mode (client and server are in the same machine) but fails when application is deployed in a a remote server.

Best regards. Roberto.
Un saludo. Roberto.

Madrid - Spain
Tfno: (+34) 625653066
E-mail: roberto.blasco.serrano@gmail.com
User avatar
Roberto Blasco
007
 
Posts: 355
Joined: Tue Apr 08, 2008 7:18 pm
Location: Madrid / Spain

Re: file plugin in web client

Postby michel » Wed Jun 23, 2010 1:10 pm

Have a look at http://wiki.servoy.com/display/public/DOCS/Servoy+5.1 under "Client Compatibility"
Michel van Klink
Vision Development
michel
 
Posts: 186
Joined: Mon Sep 22, 2008 10:53 am
Location: Boskoop, The Netherlands

Re: file plugin in web client

Postby Roberto Blasco » Wed Jun 23, 2010 2:27 pm

Thanks michael.

I forgot to say I'm working with 4.1.7 Servoy version.

Best regards. Roberto.
Un saludo. Roberto.

Madrid - Spain
Tfno: (+34) 625653066
E-mail: roberto.blasco.serrano@gmail.com
User avatar
Roberto Blasco
007
 
Posts: 355
Joined: Tue Apr 08, 2008 7:18 pm
Location: Madrid / Spain

Re: file plugin in web client

Postby lvostinar » Wed Jun 23, 2010 4:16 pm

Roberto Blasco wrote:Hi all!

Does the file plugin methods works in web-client?

i.e.

Code: Select all
controller.newRecord();
blob_field = plugins.file.readFile(client_file_path);
databaseManager.saveData();


it works in developer mode (client and server are in the same machine) but fails when application is deployed in a a remote server.

Best regards. Roberto.


When running web client the javascript will be executed on the server. This is why it only works when the server and client are on same machine. What do you want to achieve with that code ? How would you know a correct client file path ? Wouldn't it make more sense to use a server path ?
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: file plugin in web client

Postby Roberto Blasco » Wed Jun 23, 2010 5:16 pm

Hello lvostinar

I need to use this kind of functions to import files from the client side to the database.

I'm gonna use an applet to take the client path and a jsp to upload the files to the server, processing them with a batch job.

Best regards. Roberto Blasco.
Un saludo. Roberto.

Madrid - Spain
Tfno: (+34) 625653066
E-mail: roberto.blasco.serrano@gmail.com
User avatar
Roberto Blasco
007
 
Posts: 355
Joined: Tue Apr 08, 2008 7:18 pm
Location: Madrid / Spain

Re: file plugin in web client

Postby jcompagner » Thu Jul 08, 2010 10:02 am

in 5.1 you can just do that by asking for hte showFileDialog method..
Then you will get in your callback function the files that the user did select and upload.
then you can ask JSFile.getBytes() for the content of that file.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: file plugin in web client

Postby Roberto Blasco » Sat Jul 10, 2010 9:36 am

Hi jcompagner

I have to work with Servoy 4.1.7 because of my job, so I resolved it using this applet with amazing features !!! :D :D

http://jumploader.com/

Best regards. Roberto.
Un saludo. Roberto.

Madrid - Spain
Tfno: (+34) 625653066
E-mail: roberto.blasco.serrano@gmail.com
User avatar
Roberto Blasco
007
 
Posts: 355
Joined: Tue Apr 08, 2008 7:18 pm
Location: Madrid / Spain

Re: file plugin in web client

Postby nromeou » Tue Aug 24, 2010 4:23 pm

Hi Roberto,
Are you using it as a servoy plugin??
It would be nice to call it from a servoy solution.

Regards
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay


Return to Web Development

Who is online

Users browsing this forum: No registered users and 5 guests

cron