NetTalk Central

Author Topic: CHANGE PATH  (Read 4770 times)

ralonso2001

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Qúbigo ERP
    • Email
CHANGE PATH
« 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!
Regards,
Rodrigo Alonso
Mendoza - Argentina

rainerwallenius

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • Email
Re: CHANGE PATH
« Reply #1 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: CHANGE PATH
« Reply #2 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

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: CHANGE PATH
« Reply #3 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.

ralonso2001

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Qúbigo ERP
    • Email
Re: CHANGE PATH
« Reply #4 on: August 11, 2015, 03:37:57 PM »
Thank you! I'm going to work on it!!!
Regards,
Rodrigo Alonso
Mendoza - Argentina

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: CHANGE PATH
« Reply #5 on: August 11, 2015, 09:45:31 PM »
The FileDownload example shows how this is done.

cheers
Bruce