Defect #625
Files not uploading on most browsers - if files do upload screen freezes until 'Refresh'
0%
Description
v1.0.4 on Windows 2003 Server
Clients complaining about inconsistent multi-file uploading so have tested extensively as follows:
Win7 (Parallels)
--------------------
Firefox 18.0.1 Files uploaded (displayed on other WebClients) but not displayed on FF as screen freezes. Click 'Refresh' to unfreeze & display.
Chrome 24.0 File uploaded (displayed on other WebClients) but not displayed as screen freezes. Click 'Refresh' to unfreeze & display.
Opera 12.12 No files uploaded. Screen does not freeze.
Safari 5.1.7 No files uploaded. Screen does not freeze.
IE9 8.0.7600 No Files uploaded. Screen does not freeze. Cannot select multiple files with Shift/Ctrl or mouse/lasso.
OSX 10.8.2
--------------------
Firefox 18.0.1 Files uploaded (displayed on other WebClients) but not displayed on FF as screen freezes. Click 'Refresh' to unfreeze & display.
Safari 6.0.2 No files uploaded. Screen does not freeze.
Opera 12.12 No files uploaded. Screen does not freeze.
Chrome 24.0 No files uploaded. Screen does not freeze.
Files
History
Updated by Patrick Talbot over 12 years ago
That's crazy! So you're basically saying that this is no longer working in any of these browsers?
So basically not working at all?
As to Opera, It's never been tested on my end, but IE/Firefox/Chrome/Safari was working in all the tests I've done...
So what's special on your server that make all fail?
(Note also that IE9 drop can only be used in conjunction with Chrome Frame, if Chrome Frame is not present, you cannot drag and drop (but you should still be able to upload files))
Is there any firewall? Do you have a proxy (Apache/NGinx)? How do you deal with the files? What can possibly be happening that could be that different from the tests I've done (on real server as well)?
I'm puzzled.
Updated by Graham Greensall over 12 years ago
Well it's working on Firefox & Chrome(Win) but then hanging. With multiple Clients open I can see them update - but the active window is locked until a Browser 'Refresh' is triggered manually.
Not worried about Opera but wanted to provide as much info as possible.
During testing I noticed that it makes a call to blueimp.github.com before displaying the Upload window - is this expected?
Windows Server (hosted by Harjo) uses httpd-vhosts.conf file to re-direct multiple tenants to actual Port.
Code follows - can you see anything?
/** * @param {JSEvent} event * @properties={typeid:24,uuid:"6494DD5E-719B-4708-B85F-0A2F7F06F19B"} */ function multiFile_btn(event) { // 121208 // plugins.MultiFileUploader.callMultiUpload(uploadCallBack, 'in/a/sub/', {height:600,width:700,location:0,menubar:0,toolbar:0,resizable:1,status:0,scrollbars:0}) plugins.MultiFileUploader.callMultiUpload(uploadCallBack); } /** * @param {Array<JSFile>} files * @properties={typeid:24,uuid:"FE6C0F68-C52D-47A6-8CC9-A6CAEE5472B3"} */ function uploadCallBack(files) { // 130117 var vContID = forms._2__Contacts.idct; var vUser = globals.curr_User_Name; for (var i = 0; i < files.length; i++) { var obj_file = plugins.file.convertToJSFile(files[i]); forms.wx_media_ct.controller.newRecord(); forms.wx_media_ct.file_size = obj_file.size(); forms.wx_media_ct.file_blob = obj_file.getBytes(); forms.wx_media_ct.filename = obj_file.getName(); forms.wx_media_ct.file_type = obj_file.getContentType(); forms.wx_media_ct.zrid_contact = vContID; forms.wx_media_ct.created_date = new Date(); forms.wx_media_ct.created_by = vUser; } databaseManager.saveData(); contacts_to_media_ct.sort('zzid_media_ct desc'); onShow_hidePanels(); // check if TABs are hidden } /** * @properties={typeid:24,uuid:"B4CD939B-AC34-4226-BBDE-14093E5369EE"} */ function onShow_hidePanels() { // 080620 if (globals.curr_AppType == 5) { elements.btn_multifile.visible = true;} else { elements.btn_multifile.visible = true;} if ( utils.hasRecords(contacts_to_media_ct) ) { // zzid_contact-->media_ct.zrid_contact elements.media_list.visible = true; // display list of all related records elements.media_detail.visible = true; // display detail panel of selected contacts_to_media_ct.sort('zzid_media_ct desc'); // 130124*** addit code to try to force update forms.mediact_t_list.controller.setSelectedIndex(1) forms.mediact_t_list.select_MediaCT(); } else { elements.media_detail.visible = false; // hide both panels unless REL:hasRecords elements.media_list.visible = false; } }
Updated by Patrick Talbot over 12 years ago
What is the actual external URL of your server???
Because I see that your blank window is showing 'localhost:8080' which is clearly wrong for a client...
What is the URL that you see in the browser in the main frame when you call multiFile_btn(event)?
Actually, since you are behing a Apache Httpd server, Servoy doesn't see the same address that your client sees, so this could be a problem (depending on the kind of external URL your main page has).
Maybe I could add a parameter in the server admin to allow you to declare the external address of the server (when different from localhost:8080).
The calls to blueimp.github.com is for the css and bootstrap js.
I will embed them all in the /jfqu/ folder in a next version, but I doubt this is causing the issue here.
Updated by Patrick Talbot about 12 years ago
Thanks for the infos! My SMPT is down so I couldn't answer by email, will give it a try.
What's for sure looking at your code is that the fact that the files are not displayed has nothing to do with the plugin but rather with the way you are adding your records.
Instead of adding via the form and then try to sort the relationship to refresh, you should create the record through the relationship like this (and no need to convertToJSFile, files is already a JSFile[]):
for (var i = 0; i < files.length; i++) { var obj_file = files[i]; var rec = contacts_to_media_ct.getRecord(contacts_to_media_ct.newRecord()); rec.file_size = obj_file.size(); rec.file_blob = obj_file.getBytes(); rec.filename = obj_file.getName(); rec.file_type = obj_file.getContentType(); rec.zrid_contact = vContID; rec.created_date = new Date(); rec.created_by = vUser; } databaseManager.saveData(contacts_to_media_ct);
Updated by Graham Greensall about 12 years ago
Have changed code but still have same issue. Tried Firefox on OSX plus a Win7 laptop - files are being uploaded and can be seen almost immediately in a 2nd client's browser but the Client used to upload is locked until manual 'Refresh'.
Revised code as suggested:
/** * @param {JSEvent} event * @properties={typeid:24,uuid:"6494DD5E-719B-4708-B85F-0A2F7F06F19B"} */ function multiFile_btn(event) { // 121208 // plugins.MultiFileUploader.callMultiUpload(uploadCallBack, 'in/a/sub/', {height:600,width:700,location:0,menubar:0,toolbar:0,resizable:1,status:0,scrollbars:0}) plugins.MultiFileUploader.callMultiUpload(uploadCallBack2); } /** * @param {Array<plugins.file.JSFile>} files * @properties={typeid:24,uuid:"D6A364AD-895A-4B0F-AF17-3D4D39AC9E22"} */ function uploadCallBack2(files) { // 130117 // * @param {Array<JSFile>} files var vContID = forms._2__Contacts.idct; var vUser = globals.curr_User_Name; for (var i = 0; i < files.length; i++) { var obj_file = files[i]; var rec = contacts_to_media_ct.getRecord(contacts_to_media_ct.newRecord()); rec.file_size = obj_file.size(); rec.file_blob = obj_file.getBytes(); rec.filename = obj_file.getName(); rec.file_type = obj_file.getContentType(); rec.zrid_contact = vContID; rec.created_date = new Date(); rec.created_by = vUser; } databaseManager.saveData(contacts_to_media_ct); }
Updated by Patrick Talbot about 12 years ago
Check v1.0.5
I did a few changes:
1/ no external calls to blueimp.github.com for external css/js files anymore, all files are now embedded in the jqfu sub-folder
2/ call to window.opener.location.reload() upon successful upload
3/ getting rid of chrome frame in IE as this prevents the reload
I've tried on Win IE/Firefox/Chrome and Mac OS X Safari and it worked fine from a server.
Only thing is that you cannot drag and drop to IE anymore, because it's not using Chrome Frame (if you have it), so it reverts to IE default behavior which is: force usage of "Add files..." and can only select one file at the time. This is a limitation of IE, and I cannot do much against that.
Make sure you overwrite the plugin in /application_server/plugins/, but also the /jqfu folder in /application_server/server/webapps/ROOT/
Let me know if this works for you too and I'll close the issue.
Updated by Graham Greensall about 12 years ago
Bingo! Yes that's done the trick very nicely.
Tested on clients live system with Mac/Firefox and Win/Firefox and both worked fine. Many thanks for your great support!
Updated by Patrick Talbot about 12 years ago
- Status changed from New to Closed
Great!
Chrome/Safari should also be fine.
IE8/9 will work too but without the option to drag/drop and select multiple files.
As I said, it's a browser's limitation, so if users want a better experience they should choose a better browser! ;)