purtuga / SPWidgets

Sharepoint Custom UI Widgets
74 stars 34 forks source link

Issue with SPWidget File Upload Control #49

Closed rahulbabarit closed 9 years ago

rahulbabarit commented 9 years ago

Hi, I would really appreciate if you could help on this issue. I am using file upload control as below. When I am uploading the file, it seems to be uploading fine but it continues to display Working on it forever. It does not show any success/error message. Doesn't show any message in console as well.

Thanks, Rahul Babar

fileupload1

fileupload

fileupload

purtuga commented 9 years ago

Change the '&' in your alert to a '+' sign in your alert().  I'm thinking that is what a throwing an error and preventing the widget from showing the success message. 

Paul -- sent from mobile

rahulbabarit commented 9 years ago

Hi Paul,

Thanks for the response. Actually it is giving same issue without specifying onUploadDone option as well.

I changed it to + as well but still no luck. No error in console as well. If I debug onUploadDone, the control hits this function once with Action as preupload and state = 2 but then it does not proceed.

I am testing this on IE10, IE 9 & Firefox 39.0.

Thanks, Rahul Babar

purtuga commented 9 years ago

Hmmm Everything looks correct... What version of Sharepoint and Browser are you using? Also, have you tried the Demo app? does it work?


Paul T

​Sent from mobile​

rahulbabarit commented 9 years ago

I am using SharePoint 2013 on premise team site and testing using IE 9 & 10 and Firefox 39.0. I tried the demo app as well but it is behaving exactly same and not showing any success/error message. It continuously shows working on it.

Thanks, Rahul Babar

purtuga commented 9 years ago

I'm not sure what might be going on... I just tried it on O365 and it worked for me... What version of SPWidgets are you using? (ex. in the demo page, go to the last tab (i = information). Also: anything special about this document library? check in turned on?

Its possible that Sharepoint changed the way the Upload.aspx file works and because this widget is basically a wrapper around that page, it is very fragile to such changes.

Something else to try and then provide the output: turn on debug on this widget... include a input option named 'debug' and set it to true:

onUploadDone: function(){},
debug: true

In Firefox, message will output to the console debug tab... Chrome I think they just go to the normal console output.

FYI: I will be deprecating this Upload widget in the next major version... it was originally designed for SP2007 and IE8 and thus it uses a very complex screen-scraping approach inside an iframe... I'll be introducing a new Upload widget that will work with modern browsers (IE10 or higher).

rahulbabarit commented 9 years ago

Here is the version information for SPWidgets. •SPWidgets: 20150102062141 •jQuery: 1.10.2 •jQueryUI: 1.10.2 •jQueryUICss: loaded

There is no versioning/checkin enabled on this document library. Tried with different document libraries but no luck.

I tried debug option and it gave below output. In debug output the url http://spwidgetdemo//_layouts/15/UploadEx.aspx contains two "//", could it be an issue?

[1] Upload.onIframeChange(): ENTERING... Document readyState: complete IFRAME URL: http://spwidgetdemo//_layouts/15/UploadEx.aspx?List=%7B338EA131-69CB-4D75-B533-C943F509B1C3%7D&RootFolder=&Source=http%3A%2F%2Fspwidgetdemo%2F%2F_layouts%2Fimages%2FSTS_ListItem_43216.gif&1436640016367=1&

[2] Upload.onIframeChange(2): State=[1] Action=[uploading]

[3] Upload.onIframeChange(): ENTERING... Document readyState: complete IFRAME URL: http://spwidgetdemo//_layouts/15/UploadEx.aspx?List=%7B338EA131-69CB-4D75-B533-C943F509B1C3%7D&RootFolder=&Source=http%3A%2F%2Fspwidgetdemo%2F%2F_layouts%2Fimages%2FSTS_ListItem_43216.gif&1436640016274=1&

[4] Upload.onIframeChange(2): State=[1] Action=[uploading]

[5] Upload.onIframeChange(2): STARTING... Executing setTimeout(). URL:http://spwidgetdemo//_layouts/15/UploadEx.aspx?List=%7B338EA131-69CB-4D75-B533-C943F509B1C3%7D&RootFolder=&Source=http%3A%2F%2Fspwidgetdemo%2F%2F_layouts%2Fimages%2FSTS_ListItem_43216.gif&1436640016367=1&

[6] Upload.onIframeChange(2): URL is the upload page!

[7] Upload.onIframeChange(2): iframe page setup done!

[8] Upload.onIframeChange(2): STARTING... Executing setTimeout(). URL:http://spwidgetdemo//_layouts/15/UploadEx.aspx?List=%7B338EA131-69CB-4D75-B533-C943F509B1C3%7D&RootFolder=&Source=http%3A%2F%2Fspwidgetdemo%2F%2F_layouts%2Fimages%2FSTS_ListItem_43216.gif&1436640016274=1&

[9] Upload.onIframeChange(2): URL is the upload page!

[10] Upload.onIframeChange(2): iframe page setup done!

[11] Upload.onUpload(2): Start....

[12] Upload.onUpload(2): Clicking the OK button on upload form.

[13] Upload.onIframeChange(): ENTERING... Document readyState: complete IFRAME URL: http://spwidgetdemo//_layouts/15/UploadEx.aspx?List=%7b338EA131-69CB-4D75-B533-C943F509B1C3%7d&RootFolder=&Source=http%3a%2f%2fspwidgetdemo%2f%2f_layouts%2fimages%2fSTS_ListItem_43216.gif&1436640016274=1&

[14] Upload.onIframeChange(): EXITING... Gear page displyed.

Thanks, Rahul Babar

purtuga commented 9 years ago

Thanks for the output... The double forward-slash, although it should not be there, I don't think is a problem... because the page is being loaded.

from the log information above, it just looks like the file is uploaded and then hangs in the "gear" page... Are you able to upload a file to this document manually? example: using this url: http://spwidgetdemo//_layouts/15/UploadEx.aspx?List=%7B338EA131-69CB-4D75-B533-C943F509B1C3%7D&RootFolder=

Also, I think its a long shot, but try to add this additional input option to the widget:

uploadPage: "/_layouts/15/UploadEx.aspx"

/Paul

rahulbabarit commented 9 years ago

I found it is working perfectly if I create a brand new Document Library. But somehow it is giving this issue with existing libraries. I can manage with this for now.

Thanks a lot for your time and help on this Paul. Really appreciate it.

Thanks, Rahul Babar

purtuga commented 9 years ago

That is really strange... Good luck.