ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old December 29th, 2004, 01:11 PM
mikemac mikemac is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Greenville NC
Posts: 70 mikemac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 15 m 24 sec
Reputation Power: 4
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!!!!

Reply With Quote
  #2  
Old December 29th, 2004, 01:41 PM
Panther893's Avatar
Panther893 Panther893 is offline
MostarDesigns.com
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Posts: 810 Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 18 h 20 m 11 sec
Reputation Power: 56
Send a message via MSN to Panther893
i think you need to specify what type of file it is in cffile.

Reply With Quote
  #3  
Old December 29th, 2004, 03:06 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
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

Reply With Quote
  #4  
Old December 29th, 2004, 03:31 PM
mikemac mikemac is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Greenville NC
Posts: 70 mikemac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 15 m 24 sec
Reputation Power: 4
Quote:
Originally Posted by kiteless
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.


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>:&nbsp;
<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>

Reply With Quote
  #5  
Old December 29th, 2004, 04:42 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
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.

Reply With Quote
  #6  
Old December 29th, 2004, 04:49 PM
mikemac mikemac is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Greenville NC
Posts: 70 mikemac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 15 m 24 sec
Reputation Power: 4
I've tried something else.

Quote:
Originally Posted by kiteless
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.


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="clsid27CDB6E-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?

Reply With Quote
  #7  
Old December 29th, 2004, 05:28 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
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?

Reply With Quote
  #8  
Old December 29th, 2004, 05:30 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
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>

Reply With Quote
  #9  
Old December 30th, 2004, 11:34 PM
atomi atomi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 22 atomi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 5 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Displaying .swf dynamically after <cffile> upload


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway