i-e-b / jQueryFileUpload.Net

[Out of Date] .Net handler for http://aquantum-demo.appspot.com/file-upload
68 stars 54 forks source link

Problem On IE6 and fire fox 3.6.18 #1

Open ashkansiroos opened 13 years ago

ashkansiroos commented 13 years ago

Dear Friends, I have a problem using this component. When I use this component on F.F, chrome and IE7+ , everything works as they should work. The problem is when I use IE6 , and upload a file with the button, this error will shown on the page: Error: Invalid JSON: The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. Invalid at the top level of the document. Error processing resource 'http://localhost:56160/Upload.ashx'. Line 1, Positio...[{"thumbnail_url":"Thumbnail.ashx?f=cpuz_readme.txt","name":"cpuz_readme.txt","url":"Upload.ashx?f=cpuz_readme.txt","size":...

The file Already uploaded to the site but the error that has shown to user makes every thing wrong...:(

i-e-b commented 13 years ago

IE6 isn't directly supported, but I'll take a look when I can get a few hours to build a VM image. --IEB

ashkansiroos commented 13 years ago

Chould you please take a look at F.F 3.6.18? it's ok when I upload files using upload button , but on drag and drop , it returns error.... that the file is 0 KB.... Thanks alot;)

i-e-b commented 13 years ago

Upload in current version seems to work under IE6; Delete button not working.

zeeshanvigo commented 12 years ago

The delete button doesn't work in IE, in Chrome get the script error jquery 405 (method not allowed). How ever in example ALLOW operations include DELETE and others are present.

Found this upon google. http://stackoverflow.com/questions/1099787/jquery-ajax-post-sending-options-as-request-method-in-firefox

This may help, but I am testing the page locally and the domain is same. Thanks a lot for any help.

zeeshanvigo commented 12 years ago

While digging in the Main Demo scripts, found that only POST and GET are allowed by the jQuey ajax API. so to make delete work, I changed the delete_type and appened a querystring action to get the delete trigger. Change the SetValues() of the FileStatus class as.

delete_url = HandlerPath + "FileTransferHandler.ashx?f=" + fileName + "&action=delete"; delete_type = "POST";

And then catch this POST back in FileTransferHandler class in HandleMethod like this:

case "POST": case "PUT": if (!string.IsNullOrEmpty(context.Request["action"]) && context.Request["action"] == "delete") DeleteFile(context); else UploadFile(context);

                break;

This solved the Delete issue for me.

Thanks & Regards, Zeeshan