Welcome, Guest. Please login or register.
Did you miss your activation email?
02/08/12, 08:36
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  PHP, Perl, ASP, JSP, CFM (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis, nothingGrinder)
| | |-+  Coldfusion conversion from PHP file
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Print
Author Topic: Coldfusion conversion from PHP file  (Read 7824 times)
Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« on: 08/11/09, 23:39 »

Since my .CFN files have no trouble logging on, but the PHP files do, I'm trying this with coldfusion

The below PHP file works for uploading files to MySQL database.... but I'm having trouble manipulating some of the data.....
But I'm not sure how to do the equivalent uploading with coldfusion.  Any help would be appreciated, I marked the code below with //////HELP WITH THIS?

Many thanks in advance
____________________
<?php
include 'dbinfo.php';

$hash = '0';
if(isset($_GET['hash']))
   $hash = $_GET['hash'];

$id = false;
if(isset($_GET['id']))
   $id = $_GET['id'];

if($id !== false && $id !== '')
{
   $connect = mysql_connect(DBINFO_HOST, DBINFO_USER, DBINFO_PASS);
   mysql_select_db(DBINFO_DATA, $connect);
   
   $sql = 'INSERT INTO user_images (user_id, image) VALUES ("' . $id . '", "' . basename( $_FILES['Filedata']['name'] ) . '"); ';
   $row = mysql_query($sql);
}
//path to storage///////HELP WITH THIS....??
$storage = 'uploadedFiles';

//path name of file for storage
$uploadfile = "$storage/" . $hash . '-' . basename( $_FILES['Filedata']['name'] );

//if the file is moved successfully
if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] , $uploadfile ) ) {
   echo( '1 ' . $_FILES['Filedata']['name']);

//file failed to move
}else{
   echo( '0');
}

?>
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #1 on: 08/12/09, 08:18 »

Check http://www.asfusion.com/blog/entry/file-upload-with-coldfusion-flash-forms

Jorge
Logged

Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« Reply #2 on: 09/02/09, 00:22 »

I've looked at those files, and I'm having problems on trying to figure out how they fit together.  The .swf/.fla file that I found on the site just opens up a small blank window.

All it has in the flash file is the following.  How is this linked into the various CFN files?  Is the index.cfn file supposed to link to this somehow?

Thanks
_______________

import flash.net.FileReference;


var imageFile:FileReference = new FileReference();

function addListener(listener:Object):Void
{
   imageFile.addListener(listener);
}
function browse(list:Array):Void
{
   imageFile.browse(list);
}
function upload( path:String):Boolean
{
   return imageFile.upload(path);
}
function cancel():Void
{
   imageFile.cancel();
}
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #3 on: 09/02/09, 04:50 »

This is the function that calls to the server:

function upload( path:String):Boolean
{
   return imageFile.upload(path);
}

So there should be somewhere a path variable that shows the script is calling. Yo should see the example using the webserver

Jorge
Logged

Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« Reply #4 on: 10/12/09, 01:01 »

I finally have had time to spend to try to implement this, but still no luck.
I haven't gotten much help from posts on
http://www.asfusion.com/blog/entry/file-upload-with-coldfusion-flash-forms

The 'source files that you download from this site have a bunch of .cfm files and one .swf file with nothing in it.  How do you start to call these files?  With an initial .html file calling one of the .cfm files?  If so which one? 

Any help would be appreciated, I'm just stumbling all over myself trying to figure this out.

Many thanks
Logged
Eddie
Server what's that
*
Posts: 2


View Profile Email
« Reply #5 on: 10/16/09, 01:12 »

Hmmmm, that website posting very interesting, but having troubles as well implementing the code.  Anyone over here have suggestions on what to do?
Jay did you ever figure it out?
thx-E
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #6 on: 10/16/09, 05:56 »

I didn't use Coldfusion since a couple of versions, but I recall is the easiest of all back-end solutions (tag based) Here's another tutorial, focused on multiple file upload (so use Filereference list instead of Filereference) but you can change to a single one: http://www.adobe.com/devnet/coldfusion/articles/multifile_upload.html

Jorge
Logged

Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« Reply #7 on: 10/27/09, 00:06 »

I went through the step by step instructions in the link provided in your previous post.
Building it with Flex, it runs fine on my local computer, but it comes up blank when I post it live.

I just downloaded the Flex trial version, so this is my first time trying to work with Flex

(http://www.edeweb.com/multifileupload/FlexFileUpload.html)
....... a little more detail, these are the two errors that Internet Explorer gives after trying to access the file when testing it on my posted site.   

(Error: Object expected, code: 0 , URL: http://www.edeweb.com/MultiFileUpload/FlexFileUpload.html)
(Error: Object doesn't support this property or method, code: 0, URL: http://www.edeweb.com/MultiFileUpload/history.htm)

Any suggestions?

Thank you
Jason
« Last Edit: 10/27/09, 00:32 by Jaylada » Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6162


View Profile WWW Email
« Reply #8 on: 10/27/09, 00:36 »

use charles and the debug mode of flex, to finout what happens.
Logged

happy flashing
Cool
Ronald
Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« Reply #9 on: 10/27/09, 19:55 »

.....sorry.... Charles?  What do you mean?
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #10 on: 10/27/09, 22:08 »

Is an http sniffer that also show nicely amf packets, check http;//www.charlesproxy.com

Jorge
Logged

Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« Reply #11 on: 11/05/09, 17:19 »

I've finally had a chance to try what you said........
The Flex debug tool doesn't find any problems.  When running after building in Flex, it runs just fine, I'm only having issue when putting it on my website.  So I downloaded Charles, and that is a pretty cool tool, but I'm still trying to understand my issue.


I'm having two similar errors related to the Java script file, but I'm not even sure it is supposed to be calling the Java files if the swf loads successfully...... If you happen to have Charles if you can take a look at the site I'm debugging it on, and see if you know what is wrong.....  I don't know if these are the reasons why the .swf isn't getting called.  Any reason why something is referencing drive D:   ?


The .swf code doesn't seem to be getting called at all....

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
         id="FlexFileUpload" width="100%" height="100%"
         codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
         <param name="movie" value="FlexFileUpload.swf" />
         <param name="quality" value="high" />
         <param name="bgcolor" value="#869ca7" />
         <param name="allowScriptAccess" value="sameDomain" />
         <embed src="FlexFileUpload.swf" quality="high" bgcolor="#869ca7"
            width="100%" height="100%" name="FlexFileUpload" align="middle"
            play="true"
            loop="false"
            quality="high"
            allowScriptAccess="sameDomain"
            type="application/x-shockwave-flash"
            pluginspage="http://www.adobe.com/go/getflashplayer">
         </embed>
   </object>






Many thanks for the help
-J
« Last Edit: 11/05/09, 17:47 by Jaylada » Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #12 on: 11/05/09, 19:29 »

As you probably see on Charles CF says:

>Error Occurred While Processing Request</TITLE></HEAD><BODY><HR><H3>Error Occurred While Processing Request</H3><P> <TABLE BORDER><TR><TD><H4>Error Diagnostic Information</H4><P>ColdFusion cannot determine how to process the tag &lt;CFDOCUMENT&gt;. The tag name may be misspelled.<p>If you are using tags whose names begin with CF but are not ColdFusion tags you should contact Allaire Support.<P> <p>The error occurred while processing an element with a general identifier of (CFDOCUMENT), occupying document position (41:4) to (41:70).<p>The specific sequence of files included or processed is:<code><br><strong>D:\hshome\edejham7\edeweb.com\MultiFileUpload\upload.cfm &nbsp;&nbsp;&nbsp;&nbsp; </strong></code><P><P>Date/Time: 11/05/09 18:27:19<BR>Browser: Shockwave Flash<BR>Remote Address: 201.212.74.170<BR>Query String: test=Hello%20World&projectID=55<P></TD></TR></TABLE><P><HR>
</BODY></HTML>

Is strange that it says Allaire (the owner of Coldfusion until Macromedia bought it, then Adobe), are you sure you have the latest version installed? Anyway I'm not very familiar with CF to help on this

Jorge
Logged

Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« Reply #13 on: 11/23/09, 19:15 »

How about these two errors?  Does anyone have any hints as to how to fix these errors?
All of this still functions correctly when running local, but not when I post it (http://www.edeweb.com/MultiFileUpload/FlexFileUpload.html)



This one is from AC_OETags.js
_____________________
<head><title>Error in CGI Application</title></head>
<body><h1>CGI Error</h1>The specified CGI application misbehaved by not returning a complete set of HTTP headers.  The headers it did return are:<p><p><pre>Bareword found where operator expected at D:\hshome\edejham7\edeweb.com\MultiFileUpload\AC_OETags.js line 1, near "// Flash"
   (Missing operator before Flash?)
Number found where operator expected at D:\hshome\edejham7\edeweb.com\MultiFileUpload\AC_OETags.js line 1, near "Rev 1.5"
   (Do you need to predeclare Rev?)
Number found where operator expected at D:\hshome\edejham7\edeweb.com\MultiFileUpload\AC_OETags.js line 3, near ") 2005"
  (Might be a runaway multi-line // string starting on line 2)
   (Missing operator before 2005?)
Bareword found where operator expected at D:\hshome\edejham7\edeweb.com\MultiFileUpload\AC_OETags.js line 3, near "2006 Adobe"
   (Missing operator before Adobe?)
Bareword found where operator expected at D:\hshome\edejham7\edeweb.com\MultiFileUpload\AC_OETags.js line 14, nea




This one is from history.js
________________
<head><title>Error in CGI Application</title></head>
<body><h1>CGI Error</h1>The specified CGI application misbehaved by not returning a complete set of HTTP headers.  The headers it did return are:<p><p><pre>Scalar found where operator expected at D:\hshome\edejham7\edeweb.com\MultiFileUpload\history.js line 1, near "// $Revision"
   (Missing operator before  $Revision?)
Scalar found where operator expected at D:\hshome\edejham7\edeweb.com\MultiFileUpload\history.js line 2, near "1.49 $

"
   (Missing operator before ?)
Bareword found where operator expected at D:\hshome\edejham7\edeweb.com\MultiFileUpload\history.js line 2, near "// Vars"
   (Missing operator before Vars?)
syntax error at D:\hshome\edejham7\edeweb.com\MultiFileUpload\history.js line 1, near "// $Revision"
syntax error at D:\hshome\edejham7\edeweb.com\MultiFileUpload\history.js line 10, near "pairs["
syntax error at D:\hshome\edejham7\edeweb.com\MultiFileUpload\history.js line 13, near "nameValue["
syntax error at D:\hshome\edejham7\edew
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #14 on: 11/24/09, 06:33 »

This problem are related to JS, use some common library like SWFObject http://code.google.com/p/swfobject/, there's no need of using the Flex or Flash HTML template or js library

Jorge
Logged

Pages: [1] 2 Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything