Boredguy Posted September 11, 2012 Posted September 11, 2012 Hi Nick Installed v8 today to test it, and found that whenever I click a file to download it is brings up a nice 404 error to the following url https://subdomain.schooldomain/Extranet1/Download/N/Filename.extension Any suggestions?
nickbro Posted September 11, 2012 Posted September 11, 2012 Very odd, it sounds like something hasn't registered properly. Check your server's event logs to see what is being requested
Boredguy Posted September 12, 2012 Author Posted September 12, 2012 Did a complete reinstall of HAP folder and still unable to download a file. There is no errors regarding it in the Event Log, only in the IIS text log 2012-09-12 07:58:32 W3SVC1267602825 10.4.8.4 GET /Extranet1/Download/N/12-10-11.csv - 443 I am running is Windows 2003 IIS6. Hap v7 works fine downloading which is quite strange.
nickbro Posted September 12, 2012 Posted September 12, 2012 How odd that v7 worked and v8 doesn't. Since the download scripts for v8 are the same as v7. Is it happening for all files or just some?
Boredguy Posted September 13, 2012 Author Posted September 13, 2012 It's happening for all files, for different users and also from end locations. I'm going to try it on a completely different server to see if that makes a difference, it must be an issue somewhere in IIS6 if the download call hasn't changed.
nickbro Posted September 13, 2012 Posted September 13, 2012 Best is for IIS7, as IIS6 doesn't have some features
Boredguy Posted September 13, 2012 Author Posted September 13, 2012 Alas I can't reinstall our main web server yet, so stuck with IIS6 until later in the school year, so will see what I can do with it.
Boredguy Posted September 13, 2012 Author Posted September 13, 2012 Got it working... went through the instructions and noticed that the wildcard application map for aspnet_isapi.dll (step 44 of IIS6) hadn't saved in the application pool we were using. Downloading and previewing files happily now. I have noticed that the live title does not seem to update the "me" section if I login as a different account from my PC in school, but seems fine externally.
Boredguy Posted September 13, 2012 Author Posted September 13, 2012 Bah, spoke to soon with it working fine, we found another bug. When in the root of a drive, you can zip a file without any issues. If you go into a subfolder and try and zip a file it gives us as WCF error (output from firebug below) ~/scripts/jquery-1.7.2.min.js line 11 {"Message":"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter HAP.Web.API:Zip. The InnerException message was 'There was an error deserializing the object of type System.String. Encountered unexpected character 'R'.'. Please see InnerException for more details.","Detail":null,"FaultType":"NetDispatcherFaultException"}
nickbro Posted September 13, 2012 Posted September 13, 2012 Thanks for the bug report, I'll look into fixing it.
nickbro Posted September 13, 2012 Posted September 13, 2012 Can you use firebug to post what the AJAX POST is doing? It should give you details in the request of what it's asking from the api.
Boredguy Posted September 13, 2012 Author Posted September 13, 2012 See attched screenshot, hopefully it's the section you need
nickbro Posted September 13, 2012 Posted September 13, 2012 Ok, can you try this, change line 143 of ~/myfiles/default.aspx to: var a = '"' + SelectedItems()[index].Data.Path.replace(/\.\.\/download\//gi, "").replace(/\//gi, "\\\\") + '"'; Let me know if that fixes it or not. If not another screenshot like above would be great
Boredguy Posted September 13, 2012 Author Posted September 13, 2012 Hasn't fixed it. The isn't really a difference in the screenshot to make it worth uploading.. only difference was in the source part, the line went from saying { "Zip" : "N:\Reports\Reports Charlie.zip", "Paths" : ["N/Reports/Report Charlie.docx"] } to { "Zip" : "N:\Reports\Reports Charlie.zip", "Paths" : ["N\\Reports\\Report Charlie.docx"] } I tried copying in the Zip function from version 7 of HAP and it generated the same error. Also tried it with the new code and less \\ so it displayed the path as N\Reports\Report Charlie.docx and it still told me to away and put the kettle on.
nickbro Posted September 13, 2012 Posted September 13, 2012 Ok try Line 138 var a = '"' + SelectedItems()[index].Data.Path.replace(/\.\.\/download\//gi, "").replace(/\//gi, "/") + '"'; Line 143 data: '{ "Zip": "' + zipfile.replace(/\//gi, "/") + '", "Paths": [' + a + '] }',
Boredguy Posted September 14, 2012 Author Posted September 14, 2012 Amended both lines, but still getting same error message Paths ["NReportsReport Charlie.docx"] 0 "NReportsReport Charlie.docx" Zip "NReportsReport Charlie.zip" Source { "Zip": "N\Reports\Report Charlie.zip", "Paths": ["N\Reports\Report Charlie.docx"] }
nickbro Posted September 14, 2012 Posted September 14, 2012 Well that's odd because it shouldn't be using \ it should be using /
Boredguy Posted September 17, 2012 Author Posted September 17, 2012 Tried a fresh copy of the default.aspx, and added the 2 line changes in, just to make sure it wasn't picking up anything else and still erroring, so see the attached image inc source code
nickbro Posted September 17, 2012 Posted September 17, 2012 (edited) ok try this one Line 138 var a = '"' + SelectedItems()[index].Data.Path.replace(/\.\.\/download\//gi, "").replace(/\\/gi, "/") + '"'; Line 143 data: '{ "Zip": "' + zipfile.replace(/\\/gi, "/") + '", "Paths": [' + a + '] }', Edited September 17, 2012 by nickbro
Boredguy Posted September 17, 2012 Author Posted September 17, 2012 Yep that latest modification worked perfectly Nick. Zipping now happy in both root and subfolders
peterdwyer Posted October 21, 2012 Posted October 21, 2012 We are running 8.1 and if I select multiple files (eg. MS Word .DOC files) and choose "zip", HAP only places the first-selected file in the zip. I made the changes above to default.aspx but it made no change. No error is displayed but as it is "zipping", the HAP dialog box says "undefined 1 of 3 items" (if I choose 3 files and zip them). Only the first-selected file makes it into the zip Thanks
nickbro Posted October 21, 2012 Posted October 21, 2012 Ok, fixed. function Zip(zipfile, index) { temp = { Index: index, File: zipfile }; var a = '"' + SelectedItems()[index].Data.Path.replace(/\.\.\/download\//gi, "").replace(/\\/g, "/") + '"'; $.ajax({ type: 'POST', url: hap.common.resolveUrl('~/api/MyFiles/Zip') + '?' + window.JSON.stringify(new Date()), dataType: 'json', data: '{ "Zip": "' + zipfile.replace(/\\/g, "/").replace("//", "/") + '", "Paths": [' + a.replace(/\\/g, "/") + '] }', contentType: 'application/json', success: function (data) { temp.Index++; $("#progressstatus").dialog("title", hap.common.getLocal("myfiles/zip/zipingitem1") + " " + (temp.Index + 1) + " " + hap.common.getLocal("of") + " " + SelectedItems().length + " " + hap.common.getLocal("items")); $("#progressstatus .progress").progressbar({ value: (temp.Index / SelectedItems().length) * 100 }); if (temp.Index < SelectedItems().length) Zip(temp.File, temp.Index); else { temp = null; Load(); setTimeout(function() { $("#progressstatus").dialog("close"); }, 500); } }, error: hap.common.jsonError }); } Line 758: $("#progressstatus").dialog({ autoOpen: true, modal: true, title: hap.common.getLocal("myfiles/zip/zipingitem1") + " 1 " + hap.common.getLocal("of") + " " + SelectedItems().length + " " + hap.common.getLocal("items") }); Line 1153: $("#progressstatus").dialog({ autoOpen: true, modal: true, title: hap.common.getLocal("myfiles/zip/zipingitem1") + " 1 " + hap.common.getLocal("of") + " " + SelectedItems().length + " " + hap.common.getLocal("items") });
peterdwyer Posted October 22, 2012 Posted October 22, 2012 Yep - worked a treat when zipping multiple files - thanks! After my success, I then went ahead and tried to Zip a folder which contained 9 files. The resultant Zip file was empty. Is zipping folders an intended feature or is it restricted to zipping files?
nickbro Posted October 22, 2012 Posted October 22, 2012 It should work, but I don't know, it could be a limitation
peterdwyer Posted October 22, 2012 Posted October 22, 2012 I can live with it. A student queried it. I can put a disclaimer in the "announcements".
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now