|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Displaying .swf dynamically after <cffile> upload
I have a photosharing website and use <cffile> to upload images. I have recently been trying to upload .swf files and the headaches began. If I upload jpgs or gifs everything is fine but .swf's cause problems. When click on the link to display the .swf file that was uploaded I get the little broken link image. Is their something I'm missing. Is their something special that has to take place to display a .swf file??? What needs to take place to display a .swf file?
If I look at my code on the page where the file is to be displayed I see the whole <img src="thisflashmovie.swf"> line just like any other image , what am I doing wrong?? Just for good measure here is the code I use to upload my images and the code I use to try to upload .swfs. --------------------------------------------------------------------------------------------------------------------------------------- <!---Pick up UserID from log in credentials---> <CFSET UserID=ListFirst(GetAuthUser())> <CFSET newPath=#LCase(CatDesc1.Description)#> <!---Set variables for photo alias and path to store photo---> <CFSET photoDir = #ExpandPath(newPath)#> <!---Upload photo---> <cffile action="upload" destination="#photoDir#" filefield="FORM.PicFile" nameconflict="makeunique" mode="777" > <CFSET img1= #UserID# & #DateFormat(Now(),"DDMMYY")# & #TimeFormat(Now(),"HHmmss")#> <CFSET img=#ListAppend(img1,FILE.ServerFileExt,".")#> <CFFILE ACTION="RENAME" SOURCE="#photoDir#/#CFFILE.ServerFile#" destination="#photoDir#/#img#" > ------------------------------------------------------- If you want to upload a .swf image do this 1. go to photoshare.blueflydatadesign.com 2. click on the Upload Images link at the top of page 3. Sign in with these credentials: email: guestuser@blueflydatadesign.com password: 12345 4. upload the swf file and then go to the home page click the category you saved it in and view the broken link!!!! |
|
#2
|
||||
|
||||
|
i think you need to specify what type of file it is in cffile.
|
|
#3
|
|||
|
|||
|
Yes you need to use an <embed> or <object> tag to have the browser run the Flash movie within an HTML page. If you are just trying to run the .swf file by itself, confirm that the path you are generating to click on is the correct path to the .swf movie.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#4
|
|||
|
|||
|
Quote:
Firstly, thank you very much for your response! I did not know the whole <embed> requirement. So now that I'm informed I have a new question. Would checking the image name with a string function to see if it ends in .swf be valid? And if the string did end in .swf of .fla dynamically insert the <embed> tag. Below is my code I have been using for regular images...... <cfloop query="PicOutPut" startrow="#URL.StartRow#" endrow="#EndRow#"> <TD align="center"> <CFOUTPUT><img src="#LCase(CatDesc.Description)#/#PicOutPut.Alias#"</CFOUTPUT> height="100" width="100"> <BR> <B>TITLE</B>: <CFOUTPUT><a href="Gallery.cfm?PicID=#PicOutPut.PicID#"></CFOUTPUT> <CFOUTPUT>#PicOutPut.PicName#</CFOUTPUT> </a> </TD> <CFIF CurrentRow MOD 3 EQ 0></TR><TR><TD align="center" colspan="3"><img src="images/graybar.gif"></TD></TR><TR></CFIF> </cfloop> -------------------------------------------------- Now maybe I could do this...<CFOUTPUT> <!---cfif picoutput.PicIDends in .swf put start <embed> tag here---> <a href="Gallery.cfm?PicID=#PicOutPut.PicID#"> <!---And put the </embed tag here if filename ends with .swf---> </CFOUTPUT> |
|
#5
|
|||
|
|||
|
Sure you can use CFML to embed enything you want. You could also check the MIME type if you wanted to determine how to output it to the user. Remember that everything CF does is on the *server*. Once the page is sent to the browser it is just plain HTML.
|
|
#6
|
|||
|
|||
|
I've tried something else.
Quote:
OK now I have tried a little code and its not working.My code below checks to see if the image is a .swf or not. If it is it includes the appropriate code to display the movie. Well the code below will not display the movie. It shows a big white box. If you right-clck that white box the "about macromedia Flash 7" info box appears. The image that is supposed to be displayed was <cffile> uploaded to the website. Is <cffile> compatible/able to transfer .swf files? below is my code. Can I do it the way I have with the <cfoutput>s and all? -------------------------------------------------------- <cfset IsFlash=FindNoCase(".swf","#getInfo.Alias#")> <cfif IsFlash eq 0> <CFOUTPUT><img src="#LCase(getDesc.Description)#/#getInfo.Alias#"></CFOUTPUT> <cfelse> <OBJECT classid="clsid 27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="800" HEIGHT="600" id="<CFOUTPUT>#getInfo.Alias#</CFOUTPUT>"> <PARAM NAME=movie VALUE="<CFOUTPUT>#LCase(getDesc.Description)#/#getInfo.Alias#</CFOUTPUT>"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="/support/flash/ts/documents/myFlashMovie.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"> </EMBED> </OBJECT> </cfif> ----------------------------------------------- Maybe this: <CFOUTPUT><img src="#LCase(getDesc.Description)#/#getInfo.Alias#"></CFOUTPUT> and this id="<CFOUTPUT>#getInfo.Alias#</CFOUTPUT>"> is the problem??? I don't know? |
|
#7
|
|||
|
|||
|
I don't use Flash much so the details of how to embed the movie are something I can't help with. CFFILE will upload anything, CF doesn't care what kind of file it is. One check is, can you point your browser directly at the Flash movie iteself (the .swf file) and view it?
|
|
#8
|
|||
|
|||
|
I'd say you just need to play with the output you're creating...here's an example of a page with a Flash movie that definitely works...
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100%" height="100%" id="fullScreen" align="top"> <param name="movie" value="fullScreen.swf" /> <param name="loop" value="false" /> <param name="quality" value="autolow" /> <param name="scale" value="exactfit" /> <param name="wmode" value="transparent" /> <embed src="fullScreen.swf" loop="false" wmode="transparent" quality="autolow" scale="exactfit" width="100%" height="100%" name="fullScreen" align="top" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> |
|
#9
|
|||
|
|||
|
I use cfcontent to push the files out to the browser. The mime type and file location are set in a database then I generate the cfontent tag from the database information. works like a dream for any file.
-atomi |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Displaying .swf dynamically after <cffile> upload |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|