NetTalk Central

Author Topic: Saving Photo to alternate Path puts Path into Photo:Field  (Read 4497 times)

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Saving Photo to alternate Path puts Path into Photo:Field
« 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.

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Saving Photo to alternate Path puts Path into Photo:Field
« Reply #1 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

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Re: Saving Photo to alternate Path puts Path into Photo:Field
« Reply #2 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.

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Saving Photo to alternate Path puts Path into Photo:Field
« Reply #3 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.


Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Re: Saving Photo to alternate Path puts Path into Photo:Field
« Reply #4 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?

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Saving Photo to alternate Path puts Path into Photo:Field
« Reply #5 on: July 16, 2012, 03:21:18 PM »
Try ValidateAll on the form