NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: ralonso2001 on August 10, 2015, 12:50:59 PM

Title: CHANGE PATH
Post by: ralonso2001 on August 10, 2015, 12:50:59 PM
Hi, I have a form with an update file control.
I have change my upload folder in the WebHandler to a folder in disk (outside the web folder) to store the uploaded files (p_web.site.UploadsPath = CLIP(LEFT(p_web.GSV('GLOWEB:UploadsDir')))).
The files uploads and are saved with no problem to the folder, but the browse and the display field dont show the thumbnails.
For example the folder is C:\images and in the field that saves de path I am saving the full path and the file name.

What Im doing wrong?

Thank you!
Title: Re: CHANGE PATH
Post by: rainerwallenius on August 10, 2015, 09:47:38 PM
Hi Rodrigo

In my experience, webserver does not serve files outside web-folder (or maybe the program-folder).

:: rainer
Title: Re: CHANGE PATH
Post by: Bruce on August 10, 2015, 11:13:39 PM
correct - if you want to serve static files then they should be in (or below) the \web folder.
This is a security restriction because you especially do not want the server serving files from elsewhere on the machine.

It is _possible_ to serve files from other folders (see File download example) but that is dangerous and should only be done in specific cases, and not for a case like this.

cheers
Bruce
Title: Re: CHANGE PATH
Post by: kevin plummer on August 11, 2015, 05:28:13 AM
you can also use the _sendfile embed to sneakily serve the files from another location. I don't think this method is a security problem.
Title: Re: CHANGE PATH
Post by: ralonso2001 on August 11, 2015, 03:37:57 PM
Thank you! I'm going to work on it!!!
Title: Re: CHANGE PATH
Post by: Bruce on August 11, 2015, 09:45:31 PM
The FileDownload example shows how this is done.

cheers
Bruce