PDA

View Full Version : User saving images from presentation


bstoker
02-11-2005, 08:54 AM
Okay, tooling around, and can't seem to find anything, so I'll ask you all:

Is there an action, that will allow the user to save an image on from the presentation? Trying to put together a variety of images, pdf files, cad files, and the like for our companies dealers; however, these files are of no use, if they can't be saved by the user.

Thanks.

Adam
02-11-2005, 09:21 AM
You can use a File.Copy() action to save a file from your project to the users hard drive. You can use variables in this action so you should have no problems getting this going.

Please post back if you need more help.

Adam Kapilik

Worm
02-11-2005, 09:22 AM
The images are on the CD in the images folder. All you need to do is allow the user to choose a folder to "Save" to and then copy the file from the CD to the location chosen.

Adam's faster'n me

bstoker
02-11-2005, 10:04 AM
ok, having slight problems. used the help stuff to search for the Feile.Copy stuff, and thought I had a good understanding of what it was saying. I tried a few things out using examples listed. Specifically, example 1 which is:

File.Copy("AutoPlay\\Docs\\*.txt", _TempFolder .. "\\Text Files", false);

Now, I had to change a few things around in the action. Mainly the folder name from "Docs" to "Images", and then I tried everything from leaving it as broad as *.jpg to locating specific files (which is what I want to do in the first place).

However, when I preview I receive the following error code:

"There was an error copying the files to your system. Please try again".

No other messages, or info. Now, something has happened, and I'm getting nothing on the preview. When I try '_MYDOCUMENTS' as shown in example three, I get another error message "On click, Line 1: attempt to concatanate global 'MYDOCUMENTS' (a nil value).

Appreciate your input.....

I'm sure this is all operator error ;-)

Worm
02-11-2005, 10:21 AM
Does the folder _TempFolder.."\\Text Files" exist? If not, it needs to or the copy will fail. File.Copy will not dynamically create the path for you.

TJ_Tigger
02-11-2005, 11:01 AM
You may want to look at the Dialog.FolderBrowse (http://www.indigorose.com/webhelp/ams50/Program_Reference/Actions/Dialog.FolderBrowse.htm) action to allow the user to select where the file is to be copied. If they press Cancel the dialog returns "CANCEL" so you will want to check for that before doing your File.Copy (http://www.indigorose.com/webhelp/ams50/Program_Reference/Actions/File.Copy.htm).

Tigg

bstoker
02-11-2005, 11:39 AM
thanks worm, i'll check that out. i suppose it could straight into someones documents, tried that, will continue, see what i come up with.

tigger, i messed around with that action, it allowed me to create a folder, but then i suppose there would have to be another action, to copy it into folder right?

thanks again!

TJ_Tigger
02-11-2005, 11:51 AM
tigger, i messed around with that action, it allowed me to create a folder, but then i suppose there would have to be another action, to copy it into folder right?



It allows the person to create or select a folder that already exists. Once they have selected the folder you can use the returned result from the Dialog.FolderBrowse action as the destination for the File.Copy action.


strFolder = Dialog.FolderBrowse("Select Folder", _SourceFolder .. "\\AutoPlay");
if strFolder ~= "CANCEL" then --they selected a folder rather than pressing cancel
File.Copy(_SourceFolder .. "AutoPlay\\Docs\\*.txt", strFolder, false, false, false, false, nil);
end


Tigg