NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Jim A on July 14, 2012, 01:43:14 PM

Title: Saving Photo to alternate Path puts Path into Photo:Field
Post by: Jim A on July 14, 2012, 01:43:14 PM
I am using: self.site.UploadsPath = clip(self.site.WebFolderPath) & '\pictures'    -- as directed for saving the photos into a designated path (in WebHandler).  Works great.

On the Inventory Form I have INV:Photo as an Upload field.  I also have it as a Display field.  The display field under the Image Tab is prepended:

p_web.GSV('PhotoPath') & INV:Photo   [PhotoPath is set at login to '\pictures']

This works correctly -- except that it stores the PhotoPath to the name of the photo.  This causes a double PhotoPath --> '\pictures\pictures\myphoto.jpg' 

I only want the photo name to be in the field, as this is also accessed by a desktop app on the LAN.

What am I doing wrong?

Thanks.
Title: Re: Saving Photo to alternate Path puts Path into Photo:Field
Post by: Robert Iliuta on July 14, 2012, 10:50:44 PM
>I only want the photo name to be in the field, as this is also accessed by a desktop app on the LAN.
then put only the name of the photo in INV:Photo then it will works.

if you have:
p_web.SSV('PhotoPath','pictures\')
INV:Photo='myphoto.jpg'

p_web.GSV('PhotoPath') & INV:Photo = pictures\myphoto.jpg

I think this is what you want correct?

If you access this folder from a desktop app then you need to set the correct path.
"web\pictures\myphoto.jpg" or depends on your configuration.

Robert
Title: Re: Saving Photo to alternate Path puts Path into Photo:Field
Post by: Jim A on July 15, 2012, 10:16:57 AM
Hi Robert:  Almost.  The only place I reference the PhotoPath is when I display the photo -- not on the entry control.  What should be saved (as I see it) is just the Photo Name and not the path.

Thanks.
Title: Re: Saving Photo to alternate Path puts Path into Photo:Field
Post by: kevin plummer on July 15, 2012, 07:14:45 PM
I think it is designed to have a fully qualified path. However you could just strip the folder from your DB field before saving.

Title: Re: Saving Photo to alternate Path puts Path into Photo:Field
Post by: Jim A on July 16, 2012, 04:39:34 AM
Thank you Kevin, that should work.

Where would I do that?  And, do I just reference the INV:Photo field when I strip off the path?
Title: Re: Saving Photo to alternate Path puts Path into Photo:Field
Post by: kevin plummer on July 16, 2012, 03:21:18 PM
Try ValidateAll on the form