How Do You Get Filename / Image

Sannyasin Brahmanathaswami brahma at hindu.org
Mon Sep 7 10:11:01 EDT 2020


Goal: to get a folder a disk that can be copied to the web server. We have all kinds of files on disk. So, I am trying to copy a list of filename in the cards of stack. It can't that hard. But I think the method for doing the tRelativeName of filename is "broken" where are get the defaultFolder.

So I tried this. As it as simple as revCopyFile (as I discovered in that dictionary)

But this don't work!

on mouseUp
   local tImageName, tDestinationPath, tDefaultFolder
   get the effective filename of this stack
   set the itemdelimiter to "/"
   put item 1 to -2 of it into tDefaultFolder
   
   set the defaultFolder to tDefaultFolder 
   put the  defaultFolder
   # it appears correct

   --put the filename of img "slideImage" into tImageName
   
   put "ellora /DC123344.jpg" into tImageName
   put   "_ForWebSite" into tDestinationPath
   
   revCopyFile tImageName, tDestinationPath
   
end mouseup

# I'm against the wall on this!
____________
# but directed at your attempt did not work 
# as expected, no file was written

# a new attempt at your email was expecting
# but the defaultFolder was entirely different!

on mouseUp
   local tRelativeURL
   
   set the itemdelimiter to "/"
   put (the item -2 to -1 of the filename of img "slideimage" ) into tRelativeURL
   # this works is: there is a path
   # 1-ellora/dsc1234.jpg
   
   # this will work
   Set the defaultFolder to item 1 to -3 of the filename of img "slideimage"
   put the defaultFolder
# a defaultFolder appeared that was older

     put URL("binfile:" & tRelativeURL ) into URL("binfile:_ForWebSite/"& tRelativeURL)
   
end mouseUp

 Pi Digital wrote:

    I’ll try that again::

    # I’m going to assume this was a hiccup too and now fixed:
      set the filename of img “slideimage” to (item 1 to -3 of the filename of img “slideimage” & “/_ForWebSite/” & tRelativeURL)

    > On 6 Sep 2020, at 23:01, Pi Digital via use-livecode <use-livecode at lists.runrev.com> wrote:
    > 
    > # I’m going to assume this was a hiccup too and now fixed:
    >   set the filename of img “slideimage” to URL(“binfile:_ForWebSite/” & tRelativeURL)





More information about the use-livecode mailing list