Code: Select all
on mouseUp
get folderPath1
set the itemdelimiter to "/"
put "/images/" after the last item of it
put it into fld testing2
put it into fPath
if there is not a folder fPath then create folder fPath
set the filetype to ""
put fld "Field_image_name" into myVar
put (fPath & myVar) into myimageVar
--to check and see if the file path exists correctly
put myimageVar into fld testing4
--everything works to this point, I have an image displayed on a card
--I have the path to that image, Now I just need to put that image into
--the fPath so far my attempts have failed to produce a result.
--the following line produces the everything correctly but the image contents
--is zero
put image "iData" into URL ("binfile:" & myimageVar)
Code: Select all
function GetFileData pPrompt, pMacType, pWinType, pTextOrBinary
 if pPrompt is empty then put "Select a file:" into pPrompt
 if the platform is "MacOS" then
  answer file pPrompt of type pMacType
 else
  answer file pPrompt with filter pWinType
 end if
 if it is empty then exit to top
set the filename of img "iData" to it
-- test to see what the output is
put it into fld "var2"
end GetFileData
however, the file size shows as zero.
Which I think is why the above script to save the image on the users hard drive fails to produce a file size.
I have no idea why this happens, if anyone has a suggestion or a Tip, let me know.
Thanks
Tim