NetTalk Central

Author Topic: P_filename getting truncated when using UNC Path  (Read 4384 times)

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
P_filename getting truncated when using UNC Path
« on: September 05, 2012, 11:34:07 AM »
In the _SendFile embed, I am sending the photo to the page that requested it.  The p_filename being returned is built from the ImagePath (outside of the web folder) and the filename.  This works great on my machine.  When I use it on a network with the UNC Path, the last letter is being dropped for some reason.

Example:

loc:photo = photo.jpg
loc:path   = \\mypath\photos\

p_filename = clip(loc:path) & clip(loc:photo)

When it is sent back, Debugview shows:  \\mypath\photos\photo.jp

Thanks in advance for any help.

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Re: P_filename getting truncated when using UNC Path
« Reply #1 on: September 05, 2012, 01:04:15 PM »
I've been tinkering with this a bit -- and the problem appears to be that p_filename is too short.  Anyone know if this can be lengthened?

Thanks.

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Re: P_filename getting truncated when using UNC Path
« Reply #2 on: September 05, 2012, 01:23:26 PM »
Scrap that.  It finally dawned on me that I could return my own variable and not use p_filename.  All's well.

Sorry for the bother. 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: P_filename getting truncated when using UNC Path
« Reply #3 on: September 05, 2012, 11:14:28 PM »
hi Jim,

by way of an FYI...

Parameters passed in clarion as a String (not *String just String) have the "length that was passed". In other words, they cannot be made "longer". So you should avoid changing a string parameter value, unless you know for sure the length of the result will be = or shorter.

Parameters passed as a *String are different - there the actual originating variable length is used.

Cheers
Bruce

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Re: P_filename getting truncated when using UNC Path
« Reply #4 on: September 06, 2012, 05:10:37 PM »
Thanks Bruce.  Good to remember.