[Dojo-interest] problem using file uploader:dojox.embed.Flash can't be run directly from a file

Vishwajeet Borade vishwajeet_borade at fulcrumww.com
Tue Aug 2 13:06:47 EDT 2011


Thanks Andrew,

                So, basically the error means the HTML page in question must
be served by a web server 

                Rather than opening it from the C , or for that matter any,
drive.

                I was just testing the upload functionality provided by DOJO
and that's why I was opening 

                The HTML page by simply double clicking it. 

But even here I was using the Java servlet in Combination with Jakarta
commons file upload 

Utility to process the uploaded files from browser.  It's just that I was
getting that error when

Run in 'Flash Mode' otherwise in 'HTML File' mode everything was working
fine.

 

I will test the code by having web server service the file upload HTML page
and see if that 

Works. Because eventually that's the way it's  going to happen. 

 

Thanks,

Vishwajeet

 

  

 

From: dojo-interest-bounces at mail.dojotoolkit.org
[mailto:dojo-interest-bounces at mail.dojotoolkit.org] On Behalf Of Andrew
Muraco
Sent: 02 August 2011 21:15
To: dojo-interest at mail.dojotoolkit.org
Subject: Re: [Dojo-interest] problem using file uploader:dojox.embed.Flash
can't be run directly from a file

 

It's a browser security thing, you shouldn't try and get around it either.

To fix it, put all the html/js/swf onto a proper webserver (port 80 or 8080)
rather then just opening the HTML from your C:\

 

Anytime you open stuff from the C:\ it's restricted from fetching most other
resources anyways.

 

(note: you can install a lightweight http server, you'll need a server side
language to process the actual uploads too) 

On Tue, Aug 2, 2011 at 11:39 AM, vishwajeet borade
<vishwajeet_borade at fulcrumww.com> wrote:

Hello,
 I am trying to run the dojo file uploader demo example on my local
machine(Windows 7) with IE8.
 I have copied the code as it is and then just changed all the paths
pointing to dojo.js, src.js etc to
 refer to correct location on my machine.
 I am getting following error when I try to run this example in 'Flash
Plugin' mode.
>>>
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64;
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
3.0.30729; Media Center PC 6.0; InfoPath.2)
Timestamp: Tue, 2 Aug 2011 15:31:30 UTC

Message: dojox.embed.Flash can't be run directly from a file. To instatiate
the required SWF correctly it must be run from a server, like localHost.
Line: 14
Char: 21079
Code: 0
URI:
file:///C:/Users/vishwajeet_b/Documents/multiple-file-element/dojo1.6.1/dojo
/dojo.js
>>>
 Shockwave flash object is already installed on my machine.
 I have observed that this error is being thrown from Flash.js file
(line-119).
 Following check is being performed there:
location.href.toLowerCase().indexOf("file://") > -1.
 In my case ' location.href' returns absolute path of the HTML file and
thus check returns true resulting in   that exception being thrown.  But I
can't make sense of what's going on and what does it means.
Any help would be really appreciated.

Thanks,
Vishwajeet



--
View this message in context:
http://dojo-toolkit.33424.n3.nabble.com/problem-using-file-uploader-dojox-em
bed-Flash-can-t-be-run-directly-from-a-file-tp3219340p3219340.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

Dojo-interest at mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest




-- 

Andrew Muraco

Software Engineer - Java Developer

SofTrek Corporation
30 Bryant Woods North  Amherst, NY 14228
716.691.2800 x250
800.442.9211  Fax: 716.691.2828
amuraco at softrek.com  www.softrek.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20110802/baad69af/attachment.htm 


More information about the Dojo-interest mailing list