1 Reply Latest reply on Apr 18, 2006 5:11 PM by sampurtill

    fileReference uploading in Flash 8

    sampurtill
      I am having trouble here.

      I upload a file using flash and coldfusion, and if the file is made unique in the coldfusion script, flash will receive the image back that was the original file, not unique. So lets say I upload an image of a mountain named "mountain.jpg". I go and upload another mountain named "mountain.jpg" and it renames it to "mountain1.jpg" on the server. When the URL is given back to flash, it gives "mountain.jpg", so you're seeing the wrong file. If this application was huge, like myspace or something, you can understand how many problems it would have. Is there any way to send the new file back to flash? I know flash remoting in depth and could save info to a dba and take it out later from flash. I'm just trying to figure out the most effecient way of doing this.

      Thanks,

      Sam
        • 1. Re: fileReference uploading in Flash 8
          sampurtill Level 1
          I guess this is kind of a bump, but this is urgent. I'll make this easier on everyone.

          When you're writing the function for uploading, it only gives you one thing to do, a URL where it takes your data.

          I'm wondering, can you pass it to a CFC using remoting? Right now the code looks like this

          uploadListener.onSelect = function(selectedFile:FileReference):Void {
          //clean statusArea and details area
          statusArea.text = details.text="";
          // Flash is attempting to upload the image.
          statusArea.text += "Attempting to upload "+selectedFile.name+"\n";
          // Upload the file to the PHP script on the server.
          selectedFile.upload("upload.cfm");
          };

          -

          selectedFile.upload("upload.cfm") - Right now it sends back the URL of the new image (even if the image has been changed to a new file name, it will send back the image name the person tried to upload, so this will load an incorrect image). Is there any other way to do this? Or do I have to call a cfc after the file loads? This would be hard to do too cause the person may have the wrong URL saved for the image he uploaded and I don't want to send the wrong variable to Coldfusion for it to resize the image and save the info in the database.

          Thanks in advance,

          Sam