tags:

views:

50

answers:

2

Ok, so after a bit of a struggle, I got a customized button for SWFUpload. It's a transparent overlay over an inactive button. This works fine on localhost, but when I build to the test server ... it doesn't.

When I remote into the test server, it also works.

By 'working' I mean the 'browse' dialog. When I click on the button on the test server... nothing happens. And on localhost, as well as locally on the test server, I get to browse for a file to upload.

Has anyone any clue what simple fact I've overlooked here? Because I'm stumped.

A: 

Sounds like you may not be successfully running SWFUploader on your test server. Double check:

  1. your path to the .swf file
  2. your path to the swfupload.js file
  3. your permissions to the same files (the Webserver must have execute access to these files.

Good luck.

mkoistinen
Wow... I am stumped.
I'm stumped too. Perhaps you have a corrupt file somewhere? Perhaps the encoding of your js files is wrong for the test server? (CR/LF etc.)
mkoistinen
Ok, well, it's got to be a problem with flash ... right? Can't be a problem with code at this point?
I assume you're using the same browser to test both servers, correct? If not, try a known working browser with the new server. If you meant the flash files, then, no, corruption could affect any file. Also, the wrong encoding could result in your JS not working in some cases. Also, did you use FTP manually to transfer the files? If so, perhaps you forgot to switch to binary mode for the swf? These are all stabs in the dark at this point!
mkoistinen
Can you prove that your javascript is working fine with alerts or console.logs in key places? Let's rule out what we can here.
mkoistinen
Ok, this is what it was. I had the url path as: /AppCommon/swf/swfupload.swf. What it actually seemed to expect was: flash_url: "../../AppCommon/swf/swfupload.swf" ... I have no idea why. (Or how to get a return carriage in this window either.)
Ok, looks like I was on-track with my first point!
mkoistinen
You nine accepting my answer? Thanks!
mkoistinen
A: 

Ok, this is what it was.

I had the url path as:

                flash_url: "/AppCommon/swf/swfupload.swf"

What it actually seemed to expect was:

                flash_url: "../../AppCommon/swf/swfupload.swf"

I have no clue how this is different, but it is. Thank you for your help and inspiration in my troubled time of production deadline swfupload darkness!

OK, this is a path issue, just like I mentioned in my first numbered point in my post above. Unless you disagree, perhaps you could accept my answer?
mkoistinen
I came back to say it's not working in production. While it worked in unit testing with '../..', and in test with '/', in production it seems to prefer 'http://yadda/' ... but not even all the time. This isn't related to SWFUpload obv, but what am I failing to grasp here about path issues?