select image, answer
Posted: Mon Aug 13, 2007 12:33 pm
Hello, everyone,
I am very new to revolution, I have more experience in L.A.M.P. than Meta Card or Revolution, so I am trying to adjust to a new way of thinking.
I want to allow a user to choose an image as a background for a form or grouped field, (later I will be figuring out how to output the form)
I found some useful tuts that point me in the right direction for cross platform code,
However, it reads in binary and I need the actual file to display as a background or some other method of allowing the user to place an image in the stack for output later as HTML or some other method of creating the form and image data.
This code is close, it would seem to be very close to what I am looking to do except for the url part which reads the file instead of placing the file in a container ect.
This is as close as I could find to some examples of allowing the user to choose a file. I like the way this code handles the cros platform issues but apparently I am missing something about calling the file so it can be displayed,
any suggestions or thoughts would be greatly appreciated.
I am very new to revolution, I have more experience in L.A.M.P. than Meta Card or Revolution, so I am trying to adjust to a new way of thinking.
I want to allow a user to choose an image as a background for a form or grouped field, (later I will be figuring out how to output the form)
I found some useful tuts that point me in the right direction for cross platform code,
However, it reads in binary and I need the actual file to display as a background or some other method of allowing the user to place an image in the stack for output later as HTML or some other method of creating the form and image data.
This code is close, it would seem to be very close to what I am looking to do except for the url part which reads the file instead of placing the file in a container ect.
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
if pTextOrBinary is in "binary" then
put url ("binfile:"&it) into tData
else put url ("file:"&it) into tData
Err the result
return tData
end GetFileData
any suggestions or thoughts would be greatly appreciated.