www.webdeveloper.com
Results 1 to 4 of 4

Thread: Odd Chrome behavior

  1. #1
    Join Date
    May 2003
    Location
    Milwaukee
    Posts
    347

    Odd Chrome behavior

    Good afternoon, folks!

    I have a file upload form that allows me to drag and drop one or more files on the "Choose Files" button and then displays the number of files I'm about to upload...unless there is only one file, then it displays the file name. When my boss, who is also using Chrome (same version), tries it - it immediately tries to download the file(s) he dragged over to be uploaded. It's really quite strange. We're both running Win/XP (yes, still )...I've just not seen anything like this before. I am assuming it's a Windows setting, but was hoping someone here could confirm one way or another. Thanks for any help you can provide!

  2. #2
    Join Date
    Aug 2008
    Posts
    13
    If you coded the page then you need to make sure you use the Event.stopPropagation() and preventDefault() functions to prevent the browser from doing whatever it wishes when dragging and dropping files.

    I am developing a super cool drag and drop upload script and needed to use those javascript functions to prevent the page from redirecting when you drop the file on the page.
    Free, Quick, SEO Friendly Backlinks: XEGS.com Web Directory

    Free Image Hosting

  3. #3
    Join Date
    May 2003
    Location
    Milwaukee
    Posts
    347
    I understand what you're saying, but this is using just the regular HTML file input.

    Code:
    <input type="file" id="fileselect" name="fileselect[]" multiple />
    When I drag files to this input button it works fine...it will either display the file name when I drag over one file, or it will display the count of all files dragged over if they total greater than one.

    When my boss drags over the file and drops it on the input button, it instead reads the file and displays it in the browser.

  4. #4
    Join Date
    May 2003
    Location
    Milwaukee
    Posts
    347
    Okay...so I had him reinstall Chrome and it's working as expected now. Thanks for your help.

    Tom

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
  •  
HTML5 Development Center



Recent Articles