Page 1 of 1

Stream File to Application server fails

PostPosted: Fri Feb 25, 2011 9:57 am
by gzola
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.

Re: Stream File to Application server fails

PostPosted: Fri Feb 25, 2011 1:00 pm
by ROCLASI
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])

Re: Stream File to Application server fails

PostPosted: Fri Feb 25, 2011 1:26 pm
by gzola
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 ...

Re: Stream File to Application server fails

PostPosted: Fri Feb 25, 2011 1:43 pm
by ROCLASI
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 ?

Re: Stream File to Application server fails

PostPosted: Fri Feb 25, 2011 3:46 pm
by ptalbot
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.

Re: Stream File to Application server fails

PostPosted: Mon Feb 28, 2011 10:43 am
by gzola
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 ...

Re: Stream File to Application server fails

PostPosted: Mon Feb 28, 2011 11:14 am
by Zuke
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

Re: Stream File to Application server fails

PostPosted: Mon Feb 28, 2011 12:14 pm
by gzola
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

Re: Stream File to Application server fails

PostPosted: Mon Feb 28, 2011 12:36 pm
by Zuke
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.

Re: Stream File to Application server fails

PostPosted: Mon Feb 28, 2011 12:55 pm
by gzola
Zuke, now everything is clear.

Thank you for your further valuable contribution.

Regards

Re: Stream File to Application server fails

PostPosted: Mon Feb 28, 2011 1:34 pm
by lvostinar
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.

Re: Stream File to Application server fails

PostPosted: Wed Mar 02, 2011 2:28 pm
by jcompagner
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...)