Excel upload in flex 3 - apache-flex

am trying to upload excel file using filereference
however when uploading it is throwing this error
Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.
Action script error occured
after continue it is uploading the file but why that error is coming?
Thanks

contentLoaderInfo is key
loader.contentLoaderInfo.addeventListener( IOErrorEvent.IO_ERROR , someIOerrorCallBack )

Check out http://scottrockers.com/blog/resources/flash-information/workaround-solution-to-flash-error-2044-unhandled-securityerror-and-error-2048-security-sandbox-violation, but like JAX & Lee said, we need a lot more info. Are you trying to load the excel file from your computer, from a seperate domain, from localhost, from 127.0.0.1? Easiest way is if your trying to load it from a localhost url, that should work. If it's a file on disk, check your security settings http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html and enabled the directory where the file resides. If your loading it from some other domain, you need to take other precautions like a crossdomain.xml on that domain.

Are you using the .load() method of FileReference? If so, don't. Just do the .browse() method and when the selected event is triggered, have FileReference go ahead with the .upload(). The only reason you would need to use .load() is if your Flex client needs to read the bytes.

Related

Preserving file creation date while uploading file

We have an aspx-page in which files are uploaded to a server. What is important here is that the files preserves the filecreationtime.
What I'm doing after the file is uploaded to the server is trying to get the file creationtime from the source file (via FileInfo.CreationTimeUtc or File.GetCreationTimeUtc) so that I can update the target file.
The program is throwing an "Unauthorized Access Error" (on my development machine in debug mode, client and server is the same virtual machine) and on the production machine it is returning "1-1-1601 0:00:00".
How can I solve this problem.
Thanks
I found a solution to my problem. As a workaround, I use a javascript function tied to the onClientClick event (fires before the onClick) of the button excuting the upload. The FileUpload component has a property [files] an object array holding the selected file(s). An object has a property lastModifiedDate. This value I store in a hiddenfield. In the onClick method I retrieve that value.

Not able to download file name containing 'aspx' character in asp .net

Am developing asp .Net web application.
In one of my aspx file am using file to download using generic handler. Everything works great. But when am testing i felt a strange problem. That, if am uploading a image or document with file name containing aspx character for Eg; aspxphoto as file name.
Uploading doesnt have any any problem but when i try to download it is throwing error in Generic handler file as
Object reference not set to an instance of an object.
Can anyone help me why this problem happends and how can i fix it?
You will not be able to do this. The IIS handler wants to "handle" the ASPX. You should simply not allow it, or if you have to, rename it to .aspx.uploaded or something. If you allowed, it you could open yourself to hacking.
As another option, you may be able to create a virtual that implements ("no processing") - possibly using the HTTP Handler under the virtual and just disabling script / execute permissions (under handler >> Edit Feature Permission >> Script OR under Virtual >> Edit permissions >> Special >> Turn Execute off.
I would not recommend the last, since it will add complexity when migrating between test and live AND for recovery (DR).

Access to the path 'c:\windows\system32\inetsrv\19.xml' is denied

I have a grid view on page. When i click on a select button of grid view. I am getting an exception like this
Error Message: Access to the path 'c:\windows\system32\inetsrv\19.xml' is denied.
here 19 is the id of the record in the grid view.
Actually it was working fine till yesterday. but suddenly raised the exception.
Every thing here is done by a web service.Web service works fine on all pages but only on one page.The exception is raises only on production system not on development system
It is occurring on only one page. How to resolve this.
Check your create/write/reading rights on the folder the xml is in.
Your application pool identity probably does not have the appropriate rights to create/modify/open the file, causing this error to occur.
Please check the security settings and see if that fixes the error.
You need to use Server.MapPath if xml documents are located under the root of web-app.
string value="19.xml";
string file=Server.MapPath("~/folder/" + value);
...
Try to move your XML data to a DataTable.. hence remove neediness to access directly your file. When everything is done simply save back your changes into the respective xml file.

ZIP file download tries to download page

just putting this out there to see if anyone has any good off-the-cuff suggestions.
I have a web page with a button that triggers the download of a PDF file. When I run this page up in development from within VS I get the file coming back for download as expected, however since moving my web site to a staaging environment it is now yielding a very different result: When I click the download button I instead get an error and a message which seems to indicate that the call actually attempted to download the raw ASPX page rather than any ZIP file.
As this works so painlessly in my development environment, I'm assuming this must be down to environmental/configurational differences. Has anybody come across this before and if so could you inform me of the error of my ways?
Many thanks in advance
Ian
Could the aspx file be the actual zipfile ? Have you tried downloading it and open as zip?
Does the server allow for aspx to execute, eg mime-settings ?
Maybe this helps Filename and mime problems - ASP.NET Download file (C#)
Or look here How to retrieve and download server files (File.Exists and URL)

Sandbox violation while accessing image files in Flex 4

I'm working on an image gallery application. Very frequently I'm getting Sandbox violation Error like Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.. Some times its raising by cleaning the project. Every time I'm using my application's backup and updating and then the error is raising. Though I'm accessing local image files, getting error. I'm using try-catch to catch the location but no use. How to get rid of this problem. Any help is appreciated.
If u Clean the project It Will remove all your
assets files in the bin-debug folder and it will be
recreated during the Build.Some times the build wont
creates the file properly i think that time you are
getting the error.
At most avoid cleaning.It may also happens by the
out dated flash player version.
It may also happens by the following ways,
incorrect path to the upload file script - check relative and absolute paths
a incorrect location for the files to be stored on the server specified inside server-side upload script - check path is correct and permissions are correct
file is too large so server rejects it - check max file size
there is no space on the server to save the file - check server hard drive space
your actionscript handler is going out of scope because it's declared locally,
etc - create a strong event listener or declare the file reference on the class
Check one of the option and Comment is must.
About loading local images. You should check and fix Flash Player trust file for your SWF as described here. Flash Builder done it automatically but who knows…
About problem with loading images in web it can be problem related to loading images from other domain which hasn't proper crossdomain.xml file. If so you should use some kind of proxy on your server.
If you're loading files from your own domain maybe this deployment checklist can help you. Also you can use some debugging proxy like Charles to see the real queries and responses.

Resources