<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>13119</bug_id>
          
          <creation_ts>2011-07-02 10:53:49 +0000</creation_ts>
          <short_desc>Make the @value attribute in &lt;input&gt; when type=&quot;file&quot; work as a suggestion for the OS file picker</short_desc>
          <delta_ts>2011-08-04 05:01:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="brunoais">brunoaiss</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ayg</cc>
    
    <cc>brunoaiss</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50585</commentid>
    <comment_count>0</comment_count>
    <who name="brunoais">brunoaiss</who>
    <bug_when>2011-07-02 10:53:49 +0000</bug_when>
    <thetext>I&apos;d like to request to allow the value attribute to specify the text that appears in the filename section in the filepicker when the filepicker is opened.

What happens here is the following:
I, webmaster, write this code:
&lt;input type=&quot;file&quot; accept=&quot;image/jpg&quot; name=&quot;thisfile&quot; value=&quot;somefolder/file&quot;&gt;

The browser interprets as the following:
When the input tag is created its value should be the empty string (just like it is according to the actual specification).

When the file picker is opened it should filter the file list according to the accept attribute (just like it is now) and (this part is now) should fill the filename space with the string that is inside value.

This can be used in may situations. Including:
Sending the user directly to the images folder
Sending the user directly to his documents folder
Sending the user directly to his desktop
Send the file picker to its last folder (the folder it was when it was last closed) (like a: download this file, change it and then upload it)

Also, allowing the the javascript to change the @value property would be useful, still it would only change the file picker text and never the value (filepath) itself.

This might need a slight improvement but I think, with a little discussion this could have good uses. If this has good uses for applications like word, paint, etc... it should also have applications to internet websites. Specially sites that takes care of content management (like cloud computing?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50600</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-07-02 14:21:32 +0000</bug_when>
    <thetext>Mozilla would probably object to implementing this on security grounds.  Since pages can put the filepicker up from script, the proposal makes it trivial to use a user holding enter for a bit too long to put up the filepicker, select a file of the web page&apos;s choice, and send it to the server.

The use cases are good, but we need to solve the above problem before this can end up in the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50603</commentid>
    <comment_count>2</comment_count>
    <who name="brunoais">brunoaiss</who>
    <bug_when>2011-07-02 19:42:08 +0000</bug_when>
    <thetext>What could be implemented is:
When the window is opened a timer starts. If the window has been opened for less than 1s then (you must decide what to do):
- Reopen the file picker without saving the previous submitted value (must contain a max nº of times this repeats and know what to do if that counting went to 0)
- Don&apos;t accept the input. Use the previous value. (I think I&apos;ll go with this one)

What do you think of this solution?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50605</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-07-03 03:56:57 +0000</bug_when>
    <thetext>&gt; If the window has been opened for less than 1s

I doubt that&apos;s acceptable... it&apos;s too short.  3-5s is the standard I&apos;ve seen used for delays like that.

And it would _still_ screw over users who select a file quickly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50607</commentid>
    <comment_count>4</comment_count>
    <who name="brunoais">brunoaiss</who>
    <bug_when>2011-07-03 09:51:51 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; &gt; If the window has been opened for less than 1s
&gt; 
&gt; I doubt that&apos;s acceptable... it&apos;s too short.  3-5s is the standard I&apos;ve seen
&gt; used for delays like that.
&gt; 
&gt; And it would _still_ screw over users who select a file quickly.

I&apos;ve made tests with people that are slow working with the file picker and with people that are fast with the file picker.
The slow ones, take about 1s to react that the file picker have appeared.
I asked 4 slow people to go to a webpage where I&apos;d open the file picker when they less expected and see how would they react. The 1s is too little, 2s works ok, 3s still ok.
For experienced people, like me, the only reason to speed up the select of open is to check the file and give the ok. To accomplish that, I was the fastest in the tests I made (not many people actually) and I toke almost but not quite 3s to:
Confirm the filepicker was opened (about 0,4s).
Locate the file to pick (about 0,7s) (if it was to confirm what was selected, it would be about the same)
move the mouse to the file to dblclick.

Probably the 2s is the best one and better than 1s... What do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50614</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-07-03 14:49:35 +0000</bug_when>
    <thetext>I think this needs review by the security teams of the various browsers, mostly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50635</commentid>
    <comment_count>6</comment_count>
    <who name="brunoais">brunoaiss</who>
    <bug_when>2011-07-04 09:44:16 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; I think this needs review by the security teams of the various browsers,
&gt; mostly.

is there a way where I can call them all to see this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50802</commentid>
    <comment_count>7</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-07-07 21:52:47 +0000</bug_when>
    <thetext>I agree with Boris, it&apos;s unlikely that we&apos;d implement this in Firefox. It&apos;s simply too easy to trick the user into selecting a file that they don&apos;t intend to share. Here&apos;s one attack scenario:

1. Add a &lt;input type=file value=&quot;/etc/passwd&quot;&gt; on a page
2. Use CSS to make the &lt;input&gt; 1x1 pixels large
3. Put a &lt;a href=&quot;money.html&quot;&gt;Click here for free money&lt;/a&gt; link on the page
4. Use javascript to detect when the user hovers the above link
5. Use CSS to position the &lt;input&gt; just under the cursor.

Once the user attempts to click the link it will instead open a filepicker. Most people&apos;s reaction to this would be &quot;get out of my way stupid dialog, I want to click my free-money link&quot; and simply press &quot;OK&quot; in the file picker.

This is generally known as the &quot;whatever button&quot;. When faced with a dialog people generally don&apos;t bother reading its contents but instead think &quot;whatever&quot; and press any button that will allow them to continue with their task.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50835</commentid>
    <comment_count>8</comment_count>
    <who name="brunoais">brunoaiss</who>
    <bug_when>2011-07-08 10:41:14 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; I agree with Boris, it&apos;s unlikely that we&apos;d implement this in Firefox. It&apos;s
&gt; simply too easy to trick the user into selecting a file that they don&apos;t intend
&gt; to share. Here&apos;s one attack scenario:
&gt; 
&gt; 1. Add a &lt;input type=file value=&quot;/etc/passwd&quot;&gt; on a page
&gt; 2. Use CSS to make the &lt;input&gt; 1x1 pixels large
&gt; 3. Put a &lt;a href=&quot;money.html&quot;&gt;Click here for free money&lt;/a&gt; link on the page
&gt; 4. Use javascript to detect when the user hovers the above link
&gt; 5. Use CSS to position the &lt;input&gt; just under the cursor.
&gt; 
&gt; Once the user attempts to click the link it will instead open a filepicker.
&gt; Most people&apos;s reaction to this would be &quot;get out of my way stupid dialog, I
&gt; want to click my free-money link&quot; and simply press &quot;OK&quot; in the file picker.
&gt; 
&gt; This is generally known as the &quot;whatever button&quot;. When faced with a dialog
&gt; people generally don&apos;t bother reading its contents but instead think &quot;whatever&quot;
&gt; and press any button that will allow them to continue with their task.

I also go with whatever. But instead, I ALWAYS use the cancel button instead of the ok button. Still... I see what you mean...

I&apos;ll do a worksforme as this is not going to be easy enugh to implement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52469</commentid>
    <comment_count>9</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:01:45 +0000</bug_when>
    <thetext>mass-moved component to LC1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>