How does streamFilesFromServer works?

Questions, tips and tricks and techniques for scripting in Servoy

How does streamFilesFromServer works?

Postby Marco R. » Wed Oct 20, 2010 10:27 am

Hi all,

This post is similar to another but this time I have to reimport the file from server to client(smart and web).

I have tried with this kind of function call:
Code: Select all
1 - plugins.file.streamFilesFromServer(pathLocalFileName,"claims.servoy",globals.dmo_utl_fileShowErr)
2 - plugins.file.streamFilesFromServer(pathLocalFileName+"\"+fileNameWithFileExtension,fullPathInWichIFoundFileOnServerWithFileNameFileExtension,globals.functionCheckErr)
3 - plugins.file.streamFilesFromServer(pathLocalFileName+"\\"+fileNameWithFileExtension,fullPathInWichIFoundFileOnServerWithFileNameFileExtension,globals.functionCheckErr)
4 - plugins.file.streamFilesFromServer(pathLocalFileName+"/"+fileNameWithFileExtension,fullPathInWichIFoundFileOnServerWithFileNameFileExtension,globals.functionCheckErr)



I have tried all kind of separator(\,/,\\ to make the string solve the special char) but nothing work.

Another thing is : if I try to inspect the function NULL is returned,in add the global call back function is never called.

In my specific case the remotePath and the remoteFileName and remoteFileExstension are knowed,I want only allow the user to choose where save the file(by plugins.file.showFileOpenDialog).
The other function (plugins.file.streamFilesToServer(file,null,globals.functionCheckErr) works fine.

Can you show me please how can I make it work(with an example of a single file transfer)

Thanks in advance



Marco
Marco Rossi
Freelance

Main development environment: Servoy 6.1.6 - 7.4.3, Java 1.6u45,7u71 Windows 7/CentOS
Marco R.
 
Posts: 203
Joined: Thu Mar 19, 2009 12:37 pm

Re: How does streamFilesFromServer works?

Postby ptalbot » Wed Oct 20, 2010 3:39 pm

Marco (and all),

maybe this: http://www.servoyforge.net/news/43 will help you understand how the file plugin "streamFiles" to and from options work?

Cheers,
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: How does streamFilesFromServer works?

Postby Marco R. » Wed Oct 20, 2010 6:16 pm

Hi Patrick!

I hope we don't make you crazy with our questions :D

However ,thank you and thank to your partners for the sample! I have solved my import problem.I was trying to point on "c:\myFolder" when the server default path was the default (/uploads).
There is a proverb that says: "There’s nothing more elusive than an obvious fact!" :mrgreen:

regards
Marco Rossi
Freelance

Main development environment: Servoy 6.1.6 - 7.4.3, Java 1.6u45,7u71 Windows 7/CentOS
Marco R.
 
Posts: 203
Joined: Thu Mar 19, 2009 12:37 pm

Re: How does streamFilesFromServer works?

Postby ptalbot » Wed Oct 20, 2010 6:51 pm

Hi Marco, glad it works for you in the end!

I also thought: there's nothing better than a good example ;)
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC


Return to Methods

Who is online

Users browsing this forum: No registered users and 2 guests