Question

I have a pretty straight forward uploadified page that allows users to upload files, it works beautifully when I run it on my local machine accessing it through http://localhost/project/etc

the problem is when i try to access the same stuff from outside of localhost, even if trying to get to it through my machinename (http://mycomp1/project/etc), the pages load/etc and everything appears to work, but nothing is being transferred, I have firebug open and normally it will show any ajax requests that are going through but I'm getting nothing.

Any ideas?

my uploadify code:

$('#uploadify').uploadify({
    'scriptAccess': 'always',
    'uploader': '../../scripts/uploadify.swf', //flash source for handling the uploads and size checking
    'cancelImg': '../../content/images/cancel.png', //cool cancel button
    'script': '../../' + $('#Controller').val() + '/FileSave/' + $('#OrderID').val(), //sends files to the controller with apropriate data
    'folder': 'Uploads', //sets the upload directory, not sure if this matters as the files are sent to the controller
    'multi': true, //allows multiple uploads
    'auto': false, //uploads dont start automatically
    'queueSizeLimit': 5, //5 files can be in the queue at a time
    'queueID': 'fileQueue', //div to contain the queue of files
    'displayData': 'speed', //shows the transfer speed
    'fileExt': '*.pdf', //limits to pdfs
    'fileDesc': 'PDF', //shows a description in the browse window of filetypes
    'sizeLimit': '5242880', //5mb limit
    'scriptData': { 'CategoryID': $('#fileCategory').val() }, //passes the selected value of the category drop down
    onComplete: function(event, queueID, fileObj, response, data) {//once a transfer completes fires an ajax function to pull in the files for the order 
        if (response == "Upload Successful") {//if response is successfull, updates div displaying files with new files
            GetFiles($('#Controller').val());
        }
    }
});

UPDATE: It appears to be something with the scriptAccess setting but even when set to always, as said on the uploadify website it still is not firing any backend scripts or my onComplete function

UPDATE2: on further inspection it seems like my script path was not correct when in a non localhost setting, but now with the script in the right location the response im getting in my onComplete function is equal to the html output of my login page. any ideas?

UPDATE3: Looks like my script path is ok, just for some reason when not on localhost I get a response of my login page instead of upload successful or upload failed as i should from my backend code

Was it helpful?

Solution

For the login page issue, it sounds like flash is not respecting your sessions.

Assuming you are using PHP, make sure you pass your PHP sessionid in the post from your Flash object. For example, with SWF Upload this is done by passing it into the post_params settings. Then, make sure you do something like this before session start:

if( isset( $_POST['session_id'] ) && !empty( $_POST['session_id'] ) )
    session_id( $_POST['session_id'] )

session_start();

EDIT: I just noticed the ASP tag on this. I found this article regarding flash sessions in ASP. Hopefully that will help.

http://swfupload.org/forum/generaldiscussion/98

EDIT: Some more uploadify + ASP specific information.

http://www.uploadify.com/forum/viewtopic.php?f=7&t=1178

This looks really promising:::

Using Flash with ASP.NET MVC and Authentication

OTHER TIPS

Had ~same problem and solution was quite trivial - add crossdomain.xml to the visible root folder of your web server(s) Uploadify is accessing. It should contain following info

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="yourdomain"/>
</cross-domain-policy>   

Furthermore I advice you to read this manual to better understand whole point of this file.

Please try this method to see if this was a root of the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top