Image fileName problem

Thomas McGrath III mcgrath3 at mac.com
Fri May 13 16:45:10 EDT 2011


I am trying to upload an image to on-rev and am running into a problem. I wonder if anyone can help?

I have an image object named "TestImage" that I set the file name to an image on disk using the inspector icon (Folder). (This is the important part)
The inspector puts  ./../../LRS.png into the fileName field in the inspector. (I seem to remember previous versions putting the full path name instead)

The image will upload to the server using this code:
---------------
constant FTPHOST = "ftp.liveconnectonline.com/"
constant FTPUSER = "liveconnectonline%40lazyriver.on-rev.com"
constant FTPPASS = "*******"

on mouseUp
   local tFileForUpload, tFileName
   put the fileName of image "TestImage" into tFileForUpload
   set the itemdel to "/"
   put the last item of tFileForUpload into tFileName
   put empty into field "Results"
   
   local tDestination
   put "ftp://" & FTPUSER & ":" & FTPPASS & "@" & "ftp.liveconnectonline.com/liveconnectonline/ClientOne/" & tFileName into tDestination
   libURLftpUploadFile tFileForUpload, tDestination, "uploadComplete"
end mouseUp

on uploadComplete pURL, pStatus
   put "Status Update:" && pStatus && return after field "Results"
end uploadComplete
---------------

BUT the file that gets uploaded is not a true PNG file and will not open in any image processor. It also does not indicate the correct file size.

NOW if I type into the fileName field of the inspector the full path to the image -- /Users/mcgrath3/Desktop/LRS2.png  -- it then works correctly.

It is like getting the fileName with the ./../../ is not being processed correctly or that it is not what should be being entered by the inspector.

Is this normal? I don't ever remember this happening before locally with or without trying to upload to a server.

Does anyone else see what the problem might be?


Thanks


-- Tom McGrath III
http://lazyriver.on-rev.com
3mcgrath at comcast.net





More information about the use-livecode mailing list