- Previous thread: [ydn-javascript] Two Ritch text Editor in one Form Problem
- Next thread: [ydn-javascript] very strange......
- Threads sorted by date: javascript 200907
Well, I figured out the issue with this.
I modified the example to hide the progress bar initially, then show it when
the user is ready to upload.
function onFileSelect(event) {
for (var file in event.fileList) {
if(YAHOO.lang.hasOwnProperty(event.fileList, file)) {
fileID = event.fileList[file].id;
}
}
//document.getElementById('selectedFileDisplay').style.display =
"block";
document.getElementById('progressReport').value = "Ready to upload: " +
event.fileList[fileID].name;
}
See the commented out line? If that's uncommented, then it causes firefox to
reload the flash object when this function is called, which resets the flash
objects internal state and causes it to forget which file it selected.
Not the case in Safari.
Hopefully this helps somebody... I spent 20 or so hours debugging this. FML
On Thu, Jul 2, 2009 at 4:55 PM, Mark E. Haase wrote:
> I got the uploader working on my project in just a few hours on Tuesday.
> It's very nice. I did the development on Safari, so my first cross-browser
> test was to upload to the integration environment and try it in Firefox 3.
> It didn't work.
> This has led me down an agonizing path all day Wednesday and Thursday
> trying to get to the bottom of this... after painstakingly setting up an
> action script compiler and debugger and adding exception handlers and trace
> statements, I have finally begun to shed light on the issue.
>
> My setup is based very closely on this YUI example: Advanced Uploader
> Example With Additional POST Variables and Server Data Return
> .
>
> The only difference is that I have embedded it inside a dynamically loaded
> YUI panel.
>
> With logging enabled (and an exception handler in the uploader.swf itself),
> I added a log message to the actionscript constructor. Then I watched the
> trace while I select a file and then try to upload it.
>
> Here's what happens in Safari:
>
> Logging has been turned on.
>
> creating the upload AS object
>
> Multiple file upload has been turned off.
>
> The file list has been cleared.
>
> Mouse rolled over the uploader.
>
> Mouse down on the uploader.
>
> Mouse up on the uploader.
>
> Mouse click detected, launching 'Open File' dialog.
>
> Browsing for a single file.
>
> Mouse clicked on the uploader.
>
> Mouse rolled out the uploader.
>
> The file list has been cleared.
>
> Files Selected:
>
> CIMG0370.JPG
>
>
>
>
>> Started upload for file0
>
> Progress for file0: 690176 / 1539255
>
> Progress for file0: 1419264 / 1539255
>
> Progress for file0: 1539255 / 1539255
>
> Upload complete for file0
>
> Got data back for file0:
>
> {"success":true,"error":""}
>
>
> This is all good. Now here's what happens in firefox:
>
> Logging has been turned on.
>
> creating the upload ASS object
>
> Multiple file upload has been turned off.
>
> The file list has been cleared.
>
> Mouse rolled over the uploader.
>
> Mouse down on the uploader.
>
> Mouse up on the uploader.
>
> Mouse click detected, launching 'Open File' dialog.
>
> Browsing for a single file.
>
> Mouse clicked on the uploader.
>
> Mouse rolled out the uploader.
>
> The file list has been cleared.
>
> Files Selected:
>
> CIMG0370.JPG
>
>
>
> Logging has been turned on.
>
> *creating the upload AS object*
>
> Multiple file upload has been turned off.
>
> The file list has been cleared.
>
> TypeError: Error #1009: Cannot access a property or method of a null object
>> reference.
>
> at Uploader/upload()
>
> at Function/http://adobe.com/AS3/2006/builtin::apply()
>
> at flash.external::ExternalInterface$/_callIn()
>
> at ()
>
>
> As you can see, for some reason, in Firefox, the uploader object is
> re-created immediately after I select the file. (I bolded that line to make
> it clear.) When the upload function is called on the actionscript object,
> the file object is now null, and it throws that error as a result.
>
> So this is where I am. I have a huge headache from staring at the screen
> for 2 days straight. Any ideas whats going on here? Why would the uploader
> object get re-created in Firefox and not safari?
>
I modified the example to hide the progress bar initially, then show it when
the user is ready to upload.
function onFileSelect(event) {
for (var file in event.fileList) {
if(YAHOO.lang.hasOwnProperty(event.fileList, file)) {
fileID = event.fileList[file].id;
}
}
//document.getElementById('selectedFileDisplay').style.display =
"block";
document.getElementById('progressReport').value = "Ready to upload: " +
event.fileList[fileID].name;
}
See the commented out line? If that's uncommented, then it causes firefox to
reload the flash object when this function is called, which resets the flash
objects internal state and causes it to forget which file it selected.
Not the case in Safari.
Hopefully this helps somebody... I spent 20 or so hours debugging this. FML
On Thu, Jul 2, 2009 at 4:55 PM, Mark E. Haase wrote:
> I got the uploader working on my project in just a few hours on Tuesday.
> It's very nice. I did the development on Safari, so my first cross-browser
> test was to upload to the integration environment and try it in Firefox 3.
> It didn't work.
> This has led me down an agonizing path all day Wednesday and Thursday
> trying to get to the bottom of this... after painstakingly setting up an
> action script compiler and debugger and adding exception handlers and trace
> statements, I have finally begun to shed light on the issue.
>
> My setup is based very closely on this YUI example: Advanced Uploader
> Example With Additional POST Variables and Server Data Return
> .
>
> The only difference is that I have embedded it inside a dynamically loaded
> YUI panel.
>
> With logging enabled (and an exception handler in the uploader.swf itself),
> I added a log message to the actionscript constructor. Then I watched the
> trace while I select a file and then try to upload it.
>
> Here's what happens in Safari:
>
> Logging has been turned on.
>
> creating the upload AS object
>
> Multiple file upload has been turned off.
>
> The file list has been cleared.
>
> Mouse rolled over the uploader.
>
> Mouse down on the uploader.
>
> Mouse up on the uploader.
>
> Mouse click detected, launching 'Open File' dialog.
>
> Browsing for a single file.
>
> Mouse clicked on the uploader.
>
> Mouse rolled out the uploader.
>
> The file list has been cleared.
>
> Files Selected:
>
> CIMG0370.JPG
>
>
>
>
>> Started upload for file0
>
> Progress for file0: 690176 / 1539255
>
> Progress for file0: 1419264 / 1539255
>
> Progress for file0: 1539255 / 1539255
>
> Upload complete for file0
>
> Got data back for file0:
>
> {"success":true,"error":""}
>
>
> This is all good. Now here's what happens in firefox:
>
> Logging has been turned on.
>
> creating the upload ASS object
>
> Multiple file upload has been turned off.
>
> The file list has been cleared.
>
> Mouse rolled over the uploader.
>
> Mouse down on the uploader.
>
> Mouse up on the uploader.
>
> Mouse click detected, launching 'Open File' dialog.
>
> Browsing for a single file.
>
> Mouse clicked on the uploader.
>
> Mouse rolled out the uploader.
>
> The file list has been cleared.
>
> Files Selected:
>
> CIMG0370.JPG
>
>
>
> Logging has been turned on.
>
> *creating the upload AS object*
>
> Multiple file upload has been turned off.
>
> The file list has been cleared.
>
> TypeError: Error #1009: Cannot access a property or method of a null object
>> reference.
>
> at Uploader/upload()
>
> at Function/http://adobe.com/AS3/2006/builtin::apply()
>
> at flash.external::ExternalInterface$/_callIn()
>
> at ()
>
>
> As you can see, for some reason, in Firefox, the uploader object is
> re-created immediately after I select the file. (I bolded that line to make
> it clear.) When the upload function is called on the actionscript object,
> the file object is now null, and it throws that error as a result.
>
> So this is where I am. I have a huge headache from staring at the screen
> for 2 days straight. Any ideas whats going on here? Why would the uploader
> object get re-created in Firefox and not safari?
>
Conversations: [ydn-javascript] Very strange problem with uploader
- [ydn-javascript] Very strange problem with uploader by Mark E. Haase on 2009-07-02T20:57:03+00:00
- [ydn-javascript] Re: Very strange problem with uploader by Mark E. Haase on 2009-07-03T14:25:05+00:00
Related Threads
- Python-Dev - Fwd: broken mailing list links in PEP(s?) - python
- Hendrix - Facebook Home Bug - firefox
- Hendrix - Greetings! - firefox
- Bug 22636 - New: Guitar Pro 5.2 demo file browser treeview has extraneous : item - wine
- OpenBGP compare prefix from other peer - openbsd
- LAU - Samples + Synthesis synth? - linuxaudio
- Feature 1/4 - Xephyr with DRI2 extension - xorg
- R: Re: intermittent SocketException on startup tomcat 5.5.28 and under JBOSS 4.2.3GA - tomcat
- Unicode Error when Saving Django Model - django
- xfce4-session xfce4-panel - openbsd
- svn commit: r949129 - /camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java - apachecamel
- remove duplicate received from header - postfix