I tried to create a stack where I can upload image and save it automatic in the documents of my computer. And if i want it to edit the filename and it should display the right picture how do we do it in livecode. hope you can guide me. Thanks in advance
step 1. Browse a picture here is my code below
Code: Select all
on mouseUp
set the cursor to watch
answer file "Please select an image file for your product." with \
type "All Images|jpg,jpeg,gif,png|JPEG,GIFf,PNGf" or \
type "JPEG Images|jgp,jpeg|JPEG" or \
type "GIF Images|gif|GIFf" or \
type "PNG Images|png|PNGf"
put it into tImagePath
set the filename of image "ItemImg" to tImagePath
end mouseUp
step 3. once clicked it will automatic saved in the documents with filename i entered. but I don't know on how to change the filename i set in my code here is my code below
Code: Select all
on mouseUp
put fld "filenameFld" into myFileName
put ("binfile:" & specialFolderPath("Documents") & "/logo.jpg") into theFolder
export img "ItemImg" to URL theFolder as JPEG
answer "Done"
end mouseUp