Loading images to MySQL using Read/Write

Jim Schaubeck schaubeck at mac.com
Mon Feb 26 03:12:12 EST 2007


Ken,
Your script works.  The only thing that have to do which seems a little strange is emptying the image before writing a newer one to it.  For some reason the new one can not overwrite the old one...must be emptied first

Thanks Again!
Jim...

 
On Sunday, February 25, 2007, at 11:18PM, "Ken Ray" <kray at sonsothunder.com> wrote:
>On Sun, 25 Feb 2007 22:28:00 -0800, Jim Schaubeck wrote:
>
>> on mouseup
>>   ask file "Select an Image file"
>>   put it into tempvar
>>   --
>>   open file tempvar for binary read
>>   read from file tempvar until end
>>   put it into imagevar -- I'm hoping imagevar this would have the 
>> data I need to store in MySQL
>>   close file tempvar
>>   --
>>   open file "tempImageFile" for write
>
>You need to use "binary write" here, I think... 
>
>>   write imagevar to file "tempImageFile" at 1
>>   close file "tempImageFile"
>>   --
>>   set the fileName of image "image1" to "tempImageFile"
>> end mouseUp
>
>Also, wouldn't it be easier to do:
>
>on mouseUp
>  ask file "Select an Image File"
>  put it into tempVar
>  if tempVar <> "" then
>    put url ("binfile:" & tempVar) into imageVar
>    -- then the test
>    put imagevar into url ("binfile:tempImageFile")
>    set the fileName of image "image1" to "tempImageFile"
>  end if
>end mouseUp
>
>
>Ken Ray
>Sons of Thunder Software, Inc.
>Email: kray at sonsothunder.com
>Web Site: http://www.sonsothunder.com/
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution
>
>



More information about the use-livecode mailing list