+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
Home Access Plus+ Thread, [HAP+ v9.2] Various AJAX glitches with MyFiles in Projects:; Ok, the upload progress bar starts to appear from the bottom of the screen then stops, the file doesn't upload ...
  1. #16

    Join Date
    Apr 2013
    Location
    Birmingham
    Posts
    117
    Thank Post
    4
    Thanked 4 Times in 4 Posts
    Rep Power
    3
    Ok, the upload progress bar starts to appear from the bottom of the screen then stops, the file doesn't upload but the errors that were coming up about replacing the file don't come up either. The attached images shows the debug info.

    [HAP+ v9.2] Various AJAX glitches with MyFiles-debug-1.png
    Last edited by Paul-K; 17th July 2013 at 07:21 PM.

  2. #17
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,566
    Thank Post
    38
    Thanked 510 Times in 440 Posts
    Rep Power
    115
    1. Replace your ~/scripts folder with that from the full zip release
    2. Apply the 9.3 upgrade again to upgrade the scripts again (the tree script is out of date there), this will reset myfiles/default.aspx
    3. Go to edit ~/myfiles/default.aspx in notepad
    4. Line 458
    5. Change lines 458 to:
    Code:
                    console.log(this.File.name);
                    this.FileName = $("#uploadfilesrandom").is(":checked") ? this.FormatFileName() : this.File.name;
                    console.log(this.FileName);
                    return;

  3. #18

    Join Date
    Apr 2013
    Location
    Birmingham
    Posts
    117
    Thank Post
    4
    Thanked 4 Times in 4 Posts
    Rep Power
    3
    I have replaced the scripts folder from the full 9.0 Wednesday release and have applied version 9.2 again, I presume that is what you meant as I haven't seen a download for 9.3 yet? and I also applied the new baseline.css file.

    I have changed line 458 (this removes the if statement that was there) and I see the same results apart from there seem to be less errors in firebug

    [HAP+ v9.2] Various AJAX glitches with MyFiles-debug-2.png
    Last edited by Paul-K; 17th July 2013 at 07:49 PM.

  4. #19
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,566
    Thank Post
    38
    Thanked 510 Times in 440 Posts
    Rep Power
    115
    Ok, that looks all ok.

    Undo what you just did

    Line 476:
    Code:
                    $("#upload-" + this.FileName.replace(/[\\'\. \[\]\(\)\-]/g, "_") + " .progressbar").progressbar({ value: 0 });
                    console.log(this.FileName);
                    console.log(hap.common.formatJSONUrl('~/api/MyFiles/Exists/' + this.Path.replace(/\\/gi, "/").replace(/\.\.\/Download\//gi, "") + '/' + this.FileName));
                    $.ajax({

  5. #20

    Join Date
    Apr 2013
    Location
    Birmingham
    Posts
    117
    Thank Post
    4
    Thanked 4 Times in 4 Posts
    Rep Power
    3
    I replaced the default.aspx file with the original from the 9.2 upgrade then changed line 477. The error messages have appeared again about overwriting the existing file and not able to upload with a value of null. Debug info attached.

    [HAP+ v9.2] Various AJAX glitches with MyFiles-debug-3.png

  6. #21
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,566
    Thank Post
    38
    Thanked 510 Times in 440 Posts
    Rep Power
    115
    Ok, that's not correct, try this please:
    Code:
                this.Start = function() {
                    this.FileName = $("#uploadfilesrandom").is(":checked") ? this.FormatFileName() : this.File.name;
                    console.log(this.FileName);
                    if (this.File.name.indexOf('.') == -1) {
                        alert(hap.common.getLocal("myfiles/upload/folderwarning").replace(/\%/g, this.FileName));
                        uploads.pop(this);
                        return false;
                    }
                    else if ("<%=AcceptedExtensions %>".toLowerCase().indexOf(this.FileName.substr(this.FileName.lastIndexOf('.')).toLowerCase()) == -1 && "<%=DropZoneAccepted %>" != "") {
                        alert(this.File.name + " " + hap.common.getLocal("myfiles/upload/filetypewarning") + "\n\n <%=AcceptedExtensions %>");
                        uploads.pop(this);
                        return false;
                    }
                    console.log(this.FileName);
                    if(this.File.size > <%=maxRequestLength%>) {
                        alert(this.File.name + " " + hap.common.getLocal("myfiles/upload/filesizewarning"));
                        uploads.pop(this);
                        return false;
                    }
                    console.log(this.FileName);
                    $("#progresses").append('<div id="upload-' + this.FileName.replace(/[\\'\. \[\]\(\)\-]/g, "_") + '"><div class="progressbar" style="display: inline-block; width: 100px; height: 20px; vertical-align: middle; overflow: hidden;"></div> ' + this.FileName + '</div>');
                    $("#upload-" + this.FileName.replace(/[\\'\. \[\]\(\)\-]/g, "_") + " .progressbar").progressbar({ value: 0 });
                    console.log(this.FileName);
                    console.log(hap.common.formatJSONUrl('~/api/MyFiles/Exists/' + this.Path.replace(/\\/gi, "/").replace(/\.\.\/Download\//gi, "") + '/' + this.FileName));
                    $.ajax({
                        type: 'GET',
                        url: hap.common.formatJSONUrl('~/api/MyFiles/Exists/' + this.Path.replace(/\\/gi, "/").replace(/\.\.\/Download\//gi, "") + '/' + this.FileName),
                        dataType: 'json',
                        context: this,
                        contentType: 'application/json',
                        success: function (data) {
                            if (data.Name == null || confirm(hap.common.getLocal("myfiles/upload/fileexists1") + " " + this.FileName + " " + hap.common.getLocal("myfiles/upload/fileexists2"))) this.ContinueUpload(this.FileName);
                            else { 
                                $("#upload-" + this.FileName.replace(/[\\'\. \[\]\(\)\-]/g, "_")).remove();
                                if (uploads.length == 1) $("#uploadprogress").slideUp('slow');
                                uploads.pop(this);
                            }
                        }, error: hap.common.jsonError
                    });
                    return true;
                };

  7. #22

    Join Date
    Apr 2013
    Location
    Birmingham
    Posts
    117
    Thank Post
    4
    Thanked 4 Times in 4 Posts
    Rep Power
    3
    @nickbro

    I have just replaced the code above and all is working now. I have tested uploads and deleting from IE9/10, Google Chrome, Safari and Firefox using drag and drop and the upload button. Everything works perfectly in IE10, Chrome and Firefox, in IE9 and Safari the drag and drop feature doesn't appear to work it just opens up the file you are trying to upload, just thought I would let you know about those two.

    Thanks so much Nick for resolving that query so promptly.

  8. #23
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,566
    Thank Post
    38
    Thanked 510 Times in 440 Posts
    Rep Power
    115
    Very odd, it shouldn't of made any difference.

    Can you try this code
    Code:
                this.Start = function() {
                    this.FileName = ($("#uploadfilesrandom").is(":checked") ? this.FormatFileName() : this.File.name) + "";
                    if (this.File.name.indexOf('.') == -1) {
                        alert(hap.common.getLocal("myfiles/upload/folderwarning").replace(/\%/g, this.FileName));
                        uploads.pop(this);
                        return false;
                    }
                    else if ("<%=AcceptedExtensions %>".toLowerCase().indexOf(this.FileName.substr(this.FileName.lastIndexOf('.')).toLowerCase()) == -1 && "<%=DropZoneAccepted %>" != "") {
                        alert(this.File.name + " " + hap.common.getLocal("myfiles/upload/filetypewarning") + "\n\n <%=AcceptedExtensions %>");
                        uploads.pop(this);
                        return false;
                    }
                    if(this.File.size > <%=maxRequestLength%>) {
                        alert(this.File.name + " " + hap.common.getLocal("myfiles/upload/filesizewarning"));
                        uploads.pop(this);
                        return false;
                    }
                    $("#progresses").append('<div id="upload-' + this.FileName.replace(/[\\'\. \[\]\(\)\-]/g, "_") + '"><div class="progressbar" style="display: inline-block; width: 100px; height: 20px; vertical-align: middle; overflow: hidden;"></div> ' + this.FileName + '</div>');
                    $("#upload-" + this.FileName.replace(/[\\'\. \[\]\(\)\-]/g, "_") + " .progressbar").progressbar({ value: 0 });
                    console.log(hap.common.formatJSONUrl('~/api/MyFiles/Exists/' + this.Path.replace(/\\/gi, "/").replace(/\.\.\/Download\//gi, "") + '/' + this.FileName));
                    $.ajax({
                        type: 'GET',
                        url: hap.common.formatJSONUrl('~/api/MyFiles/Exists/' + this.Path.replace(/\\/gi, "/").replace(/\.\.\/Download\//gi, "") + '/' + this.FileName),
                        dataType: 'json',
                        context: this,
                        contentType: 'application/json',
                        success: function (data) {
                            if (data.Name == null || confirm(hap.common.getLocal("myfiles/upload/fileexists1") + " " + this.FileName + " " + hap.common.getLocal("myfiles/upload/fileexists2"))) this.ContinueUpload(this.FileName);
                            else { 
                                $("#upload-" + this.FileName.replace(/[\\'\. \[\]\(\)\-]/g, "_")).remove();
                                if (uploads.length == 1) $("#uploadprogress").slideUp('slow');
                                uploads.pop(this);
                            }
                        }, error: hap.common.jsonError
                    });
                    return true;
                };
    The other code won't work unless you open the developer tools in the browser. Safari doesn't support drag and drop upload

  9. Thanks to nickbro from:

    Paul-K (17th July 2013)

  10. #24

    Join Date
    Apr 2013
    Location
    Birmingham
    Posts
    117
    Thank Post
    4
    Thanked 4 Times in 4 Posts
    Rep Power
    3
    Changed the code as above but IE9 still doesn't work with drag and drop, I have tried this on my work machine with IE9 and by putting IE10 on my home machine into IE9 browser and document mode.

  11. #25
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,566
    Thank Post
    38
    Thanked 510 Times in 440 Posts
    Rep Power
    115
    IE9 doesn't support drag and drop either, only came in IE10

  12. #26

    Join Date
    Apr 2013
    Location
    Birmingham
    Posts
    117
    Thank Post
    4
    Thanked 4 Times in 4 Posts
    Rep Power
    3
    Ahh right, I didn't realize that IE9 doesn't support it, in that case the code you supplied is working perfectly.

    Thanks again Nick

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. HAP+ v9 - Basic CSS - Tweaking the colour scheme
    By mattgrimley in forum Home Access Plus+
    Replies: 18
    Last Post: Yesterday, 01:46 PM
  2. HAP V9.0 Setup
    By itdaveh in forum Home Access Plus+
    Replies: 2
    Last Post: 23rd May 2013, 01:44 AM
  3. [HAP+][v9] Planned Features
    By nickbro in forum Home Access Plus+
    Replies: 121
    Last Post: 30th April 2013, 08:55 AM
  4. Replies: 17
    Last Post: 24th April 2013, 12:17 PM
  5. [HAP+][v9] Booking System Error
    By mrbios in forum Home Access Plus+
    Replies: 18
    Last Post: 22nd April 2013, 12:38 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •