Stream File to Application server fails

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

Stream File to Application server fails

Postby gzola » Fri Feb 25, 2011 9:57 am

Hello.

I'm having this problem with the plugin file and webclient solution.

Code: Select all
plugins.file.streamFilesToServer (files, upldPathFileLocal, uploadFinished)


If I upload the FILE with the Developer in the Default folder is okay, about the exact same operation with the Application Server in the same machine and same folder, instead, fails with no error in the logs.

I checked the permissions on the folder UPLOADS without finding problems...

Can someone help me understand what I'm doing wrong? I'm in trouble and is an emergency!! :( :( :( :( :( :( :(

Thanks for the help you can give me.
Giovanni Zola
Servizio Innovazione Informatica
Comune di Nuoro

Version: 5.2.4 - build 1006
Java version 1.6.x (Windows 2000/2003 - XP - Vista - Windows 7)
Mysql 5.0
User avatar
gzola
 
Posts: 91
Joined: Mon Nov 29, 2004 2:24 pm
Location: Nuoro, Sardegna, Italy

Re: Stream File to Application server fails

Postby ROCLASI » Fri Feb 25, 2011 1:00 pm

Hi Giovanni,

What does the variable upldPathFileLocal hold ? Is it a path name ?
This function can only have filenames as far as I can see:
Code: Select all
plugins.file.streamFilesToServer(file/fileName|fileArray/fileNameArray,[serverFile/serverFileName|serverFileArray/serverFileNameArray],[callbackFunction])
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Stream File to Application server fails

Postby gzola » Fri Feb 25, 2011 1:26 pm

ROCLASI wrote:Hi Giovanni,

What does the variable upldPathFileLocal hold ? Is it a path name ?
This function can only have filenames as far as I can see:
Code: Select all
plugins.file.streamFilesToServer(file/fileName|fileArray/fileNameArray,[serverFile/serverFileName|serverFileArray/serverFileNameArray],[callbackFunction])


Hi Robert. Thanks for the reply.
Yes is a path name. Otherwise it would not work even with the Developer.

I just found out that if you launch the Application Server with the <servoy_server.bat> and not as a service, everything works fine.

I also checked if the libraries using the service and the file BAT are identical, as well as the permissions on the folder UPLOAD and the permissions of the service.
I do not know give me an explanation ...
Giovanni Zola
Servizio Innovazione Informatica
Comune di Nuoro

Version: 5.2.4 - build 1006
Java version 1.6.x (Windows 2000/2003 - XP - Vista - Windows 7)
Mysql 5.0
User avatar
gzola
 
Posts: 91
Joined: Mon Nov 29, 2004 2:24 pm
Location: Nuoro, Sardegna, Italy

Re: Stream File to Application server fails

Postby ROCLASI » Fri Feb 25, 2011 1:43 pm

Hi Giovanni,

This sounds to me as a permission issue. When running as a service it usually runs under a different user than when launched using the BAT.
I am not that familiar with the Windows side of things but can you see if the upload folder is accessible for services ?
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Stream File to Application server fails

Postby ptalbot » Fri Feb 25, 2011 3:46 pm

Yes, Robert is right, it sounds like a permission issue.
I suppose your service is using a Local System account that doesn't have write permissions on the uploads folder.

It can also be (on Win 2003 and 2008 I have seen it in some cases) that the uploads folder is not where you think it is, maybe try to set it explicitely in the server-admin plugin's page and be sure that the permissions are set correctly.
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: Stream File to Application server fails

Postby gzola » Mon Feb 28, 2011 10:43 am

Hello guys.
I'm sorry but it is the first check I made. The system account has full access to the upload folder. In any event I run the service with the Administrator account without solving the problem.

I also tried to Set explicitely the path of the folder upload ...

I'm still in the dark ...
Giovanni Zola
Servizio Innovazione Informatica
Comune di Nuoro

Version: 5.2.4 - build 1006
Java version 1.6.x (Windows 2000/2003 - XP - Vista - Windows 7)
Mysql 5.0
User avatar
gzola
 
Posts: 91
Joined: Mon Nov 29, 2004 2:24 pm
Location: Nuoro, Sardegna, Italy

Re: Stream File to Application server fails

Postby Zuke » Mon Feb 28, 2011 11:14 am

Hi

As Patrick suggests, the folder may not be where you think it should be, in our case, when we did an app output on the default folder it turned out to be the user home folder that was in use by the service.
Probably worth checking this first.

We got around this by hard coding a custom folder within the app server 'c:\uploads...' etc.

Regards
McCourt Cordingley (Zuke)
(Version: 6.0.6 - Windows 7 - SQL Server 2008 R2 - Backbox Linux)
Zuke
 
Posts: 153
Joined: Wed Jun 03, 2009 4:48 pm
Location: Newcastle Upon Tyne, UK

Re: Stream File to Application server fails

Postby gzola » Mon Feb 28, 2011 12:14 pm

Hello Zuke and thank you very much for contribution.

You've finally shed light on the problem. The folder was placed on the desktop of the Default User and I, logging into the server with Administrator user, not the saw.

However, I remain in doubt. Why when Servoy run from the bat file, also in the absence of explicit setup of the path, it use the correct UPLOADS folder in the installation folder of Servoy and the service not? (Administrator used in both case)

Greetings
Giovanni Zola
Servizio Innovazione Informatica
Comune di Nuoro

Version: 5.2.4 - build 1006
Java version 1.6.x (Windows 2000/2003 - XP - Vista - Windows 7)
Mysql 5.0
User avatar
gzola
 
Posts: 91
Joined: Mon Nov 29, 2004 2:24 pm
Location: Nuoro, Sardegna, Italy

Re: Stream File to Application server fails

Postby Zuke » Mon Feb 28, 2011 12:36 pm

Hi

This is the case, its just the way it works in terms of how windows see's, a service login.
It uses an actual account for starting the service, as the service is not directly started from within the servoy file structure,
it uses the service account home unless otherwise specified in the app server,
however when you run from a batch it looks in the dir it was started from for file paths.

Hope this makes sense.

PS Better to run as a service most of the time.
McCourt Cordingley (Zuke)
(Version: 6.0.6 - Windows 7 - SQL Server 2008 R2 - Backbox Linux)
Zuke
 
Posts: 153
Joined: Wed Jun 03, 2009 4:48 pm
Location: Newcastle Upon Tyne, UK

Re: Stream File to Application server fails

Postby gzola » Mon Feb 28, 2011 12:55 pm

Zuke, now everything is clear.

Thank you for your further valuable contribution.

Regards
Giovanni Zola
Servizio Innovazione Informatica
Comune di Nuoro

Version: 5.2.4 - build 1006
Java version 1.6.x (Windows 2000/2003 - XP - Vista - Windows 7)
Mysql 5.0
User avatar
gzola
 
Posts: 91
Joined: Mon Nov 29, 2004 2:24 pm
Location: Nuoro, Sardegna, Italy

Re: Stream File to Application server fails

Postby lvostinar » Mon Feb 28, 2011 1:34 pm

gzola wrote:
However, I remain in doubt. Why when Servoy run from the bat file, also in the absence of explicit setup of the path, it use the correct UPLOADS folder in the installation folder of Servoy and the service not? (Administrator used in both case)

Greetings


Indeed this is a bug, Servoy should see the correct folder in both cases. This is fixed already in Servoy 6.0 (default folder detection is improved). In 5.2 you should set the upload folder in the settings.
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: Stream File to Application server fails

Postby jcompagner » Wed Mar 02, 2011 2:28 pm

that said.. (by laurian)

you should if you really use the streaming, define a hard coded path..
Because we are just trying to do a default thing, but placing them in ROOT/uploads is not always the best thing because that is accessible in the browser...
So if you use streaming, configure the file plugin correctly by defining your own path (and if you do want it the be accessible in the browser i would still configure it...)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Web Development

Who is online

Users browsing this forum: No registered users and 6 guests

cron