save an image url

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

save an image url

Post by Silvio.Falconi »

when I save an Image the url is

"C:\WORK\PRG\WINBEACH\images\due_lettini_regista.png"

I wish save as " ..\images\due_lettini_regista.png"

how I can resolve ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: save an image url

Post by Otto »

Silvio,
you have all the functions inside
c:\fwh\source\function\filename.prg.
Did you see that Antonio announced the availability of the mod harbour servers?

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: save an image url

Post by Silvio.Falconi »

Otto,
Sorry,
For now i cannot use mod_harbour
I must terminate my app
I tried with mod_harbour with no success
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: save an image url

Post by Silvio.Falconi »

Otto ,
sorry I TRIED with these functions

//?cFileNoPath( cPathMask )
//?cFilePath( cPathMask )
//?cFileDisc( cPathMask )
//?cFileNoExt( cPathMask )
//?cFileSubDir( cPathMask )
//? cFileUNC( cPathMask )
//? cRelativePath( cPathMask )

with no success!!!!

none give me ..\images\name.png
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: save an image url

Post by Silvio.Falconi »

Resolved

Code: Select all

Function test()
Local cPathMask:="C:\WORK\PRG\WINBEACH\images\due_lettini_regista.png"

? RelativePath( cPathMask ) + UrlImage(cPathMask)
return nil

Function UrlImage(curlImg)  
   Local aTmp
   local nLevel := 1
   local x
   local cCad   :=""
   aTmp := Hb_ATokens( curlImg, "\" )
   For x = Len( aTmp ) - nLevel + 1 To Len( aTmp )
       cCad += AllTrim( aTmp[ x ] )
       if x < Len( aTmp )
          cCad  += "\"
       endif
   Next x
  return cCad

 Function RelativePath( cFile )
   local cPath, cRelPath, cTemp
   cPath:= cFilePath(cFile)
   cTemp:= left(cPath,len(cPath)-1)
   cRelPath:=  "." + right(cPath, len(cPath) + 1 - rat("\",cTemp) )
return cRelPath
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply