|
Mailing Lists
|
Home / Groups / ColdFusion Newbie (CF-Newbie)
cfinput type File Convert filepath to URL addressHi Toni - I've encountered something similar. I'm not sure if my approach is the best way, but I can describe what I dealt with. I had to link to files users uploaded from an award nomination form. All the files were in the same directory. I knew I could reference them with cfdirectory so I did this: <cfdirectory directory="#ExpandPath('/awards/chancellorsProfessors/nominationUploads/#fname#_#lname#/')#" recurse="true" name="nomineeFiles"> I then output all the files like this: <cfoutput query="nomineeFiles"> <ul> <li><a href="#nomineeFiles.name#">#nomineeFiles.name#</a></li> </ul> </cfoutput> This did output all the files in the directory, but with the way the link is referencing the file, it was a system path to the file on the server, not a typical hyperlink I ended up creating another variable called "filePath." <cfset filePath = "http://webaddress to directory/"> I then changed the hyperlink to: <li><a href="#filePath##nomineeFiles.name#">#nomineeFiles.name#</a></li> This worked for me. Maybe something similar will work for you. |
February 08, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||