How to 'clear' file upload field in forms

In a form I am designing I need a 'clear' or 'reset' button that clears the entire form. This is easy to do, of course, but alas my form has a file upload field, and in Safari I just can't get that field to go back to it's default empty state.
is there a secret way to force file upload fields in safari to reset, or is it just impossible?

I've just done a quick search on bugzilla and came up with this http://bugzilla.opendarwin.org/show_bug.cgi?id=8248.

Similar Messages

  • Unable to clear file upload fields in web pages.

    When visiting any site which has the option to upload a file, I am unable to clear the field if I change my mind about uploading a file.
    A website has a BROWSE or UPLOAD field and button. Pressing the button brings up the open file dialog. I select a file and select open in the dialog. If I then click on the field containing the path/file, I am presented with the open file dialog. I cannot clear or edit the field on the web page.
    I originally thought it was something with the web page I visited, but then found another page did the same thing.

    For instance if you go to this page again in Safari,
    http://www.apple.com/quicktime/qtv/mwsf06/
    and then select "View Source" from the View menu, then press command-f to "find" within the page and search for ".mov"
    You will find this, which shows the url of the movie itself.
    <param name="href" value="http://stream.qtv.apple.com/events/jan/mw2006/mmw_2006_650ref.mov">
    If you copy just this part:
    http://stream.qtv.apple.com/events/jan/mw2006/mmw_2006_650ref.mov
    And open QuickTime Player, go to the File menu, select "Open URL" the movie will play.
    If you try the same technique on the page at the link provided by your client, it will allow you to bypass the html code that may be doing an outdated compatibility check and the movie may play. Or it may tell you that you are missing components (codecs, compressors etc.) in which case, post here again.

  • File Upload field wiht Camera option!

    Hi, I'm a web developer and I'd like to make my application accessible also from tablet. I tried the website with both default android Browser and Firefox browser; I saw that Firefox it is much more user friendly to touch and fast.
    In the website there is a form with a file upload field that is supposed to be used with images; the default android Browser gives the user the possibility to choose the camera, take the picture, and then select it for the upload. I'd like to know if there is the possibility to configure somewhere Firefox to add the Camera option with Astro and OpenOfficeDoc. Do you think is possible?
    Or do you know how this could be realized?
    Thank you in advance.
    Federica

    Interesting! I think there is a different site to offer feature suggestions for different Mozilla products, but I'm not sure where the Android one is. (I'm assuming that the option isn't available yet...)

  • File Upload in a Form

    I have a file upload in a form of mine.
    I can't style the upload to match the rest of my form. I have tried to target the id="FileAttachment" to no avail. I have tried adding classes and nothing responds.
    In Dreamweaver it shows as styled until it gets on the web.
    Here is the site: http://ubhape2remodel.businesscatalyst.com/careers
    Any Advice?
    Thanks!

    Thanks for the information.
    I cannot get it to work and I am unsure why.  I am not sure if I am not using the JS right or not adding something to the css. I am a bit confused.
    I am not all that good at javascript so I assume something here is off and I am just missing it.
    One other note: Is it possible to use my style of buttons and not an image (I would like the hover effect that I use on the buttons to apply to that one as well.) But not sure how this can be done or if it is possible.
    Any help would be very very much appreciated.
    http://ubhape2remodel.businesscatalyst.com/careers
    Thanks!

  • Problem in dynamically generating the file upload field

    Hello all
    I am using netbeans 5.5 and visualwebpack for my jsf project.
    i have a problem in dynamically generating the file upload field and using it.
    I have a panel say "panelA" which holds file upload fields.
    Depending upon the count value i generate the file upload field using following code snippet:
    Upload upload1 = new Upload();
    upload1.setId("upload1");
    getPanelA.getChildren().add(upload1);
    The page successfully shows up the file upload fields. While the user clicks the submit button, i have used following logic to perform upload:
    List components = getPanelA().getChildren();
    for(int i = 0; i<components.size(); i++){
    if(components.get(i) instanceof Upload){
    UploadedFile uploadedFile = ((Upload)components.get(i)).getUploadedFile();
    I am getting this UploadedFile object null.
    How can i solve this problem.

    Anyway,
    I solved the problem.
    Actually i was using label property of the upload field due to which i got null pointer exception.
    I removed the label property of the upload field and things worked as i wanted.

  • Retain selected file on File Upload field

    I have a wizard consisting of 3 forms. The first form has a file upload field.
    The selected file name is not retained when i navigate from the first form to the second and then back again to the first form.
    I have tried to using javascript to record the selected filename in another field and then hoping that i can then repopulate the file upload 'text' box. However, this has failed as it appears that the file name selected is not the 'value' or 'text' of the file upload field.
    Any ideas?

    Some PC "windows" browsers need ".ogg" files in order to play.
    Just a heads up.
    I use jPlayer works on mac, Pc, & iOS
    http://jeffnitschke.com/Help.html

  • File upload problem when form consists of more than 5 elements

              Hi,
              I noticed some bizarre behaviour that only occurs when going through an ssl proxy
              link to httpclusterservlet on our clustered environment, does not occur without
              ssl proxy.
              I have two different multipart forms One of them has:
              1.one file upload field and 7 other input fields
              The other one has:
              2.one file upload field and 2 other input fields
              Number 2 works as expected,
              but number 1-- it appears as if my servlet is called twice and the stream is corrupt--
              for example it starts of with the boundary, but after the fifth element half it
              gets cut off and then my servlet is called again with the remaining elements leaving
              off with where it was cut off.
              I don't think this is normal behaviour.
              Any ideas?
              

              Hi,
              I noticed some bizarre behaviour that only occurs when going through an ssl proxy
              link to httpclusterservlet on our clustered environment, does not occur without
              ssl proxy.
              I have two different multipart forms One of them has:
              1.one file upload field and 7 other input fields
              The other one has:
              2.one file upload field and 2 other input fields
              Number 2 works as expected,
              but number 1-- it appears as if my servlet is called twice and the stream is corrupt--
              for example it starts of with the boundary, but after the fifth element half it
              gets cut off and then my servlet is called again with the remaining elements leaving
              off with where it was cut off.
              I don't think this is normal behaviour.
              Any ideas?
              

  • How to clear file history in Teststand file menu?

    How to clear file history in Teststand "file" menu?
    Thanks!

    Hey Jacky,
    I have found a Knowledgebase
    that I believe describes what you are looking for.  The registry
    key may be different depending on which version of TestStand you are
    using.  The only thing that should change is the version
    number.  Have a good one!
    Message Edited by Patrick P. on 03-31-2006 02:59 PM
    Pat P.
    Software Engineer
    National Instruments

  • How do I add a file upload to my form?

    I need to be able to collect multiple files from a web form in order to keep them together.

    Hi DonPhilyaw,
    You can add a attach a file button in your form and you can get all the attachments at one place.
    Thanks,
    Vikrantt Singh

  • File upload field

    I have a profile update page, with a file field where the user can upload a photo.
    But I have a major problem. I know that the fileupload form cannot contain a value from a database.
    When I submit the form without the image, it resets the photo field to blank.
    I would like to know:
    How can I upload a photo with checking if the same name is already in the folder?
    How can I leave the field intact so that the current image stays on blank field?
    This is my code
    SQL
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "update_business")) {
      $updateSQL = sprintf("UPDATE users SET company_name=%s, comp_add1=%s, comp_add2=%s, comp_add3=%s, comp_city=%s, comp_postcode=%s, comp_tel=%s, comp_fax=%s, comp_email=%s, comp_web=%s, comp_description=%s, honors_awards=%s, industry=%s, logo=%s, bul1=%s, bul2=%s, bul3=%s, bul4=%s, bul5=%s, bul6=%s WHERE user_id=%s",
                           GetSQLValueString($_POST['company_name'], "text"),
                           GetSQLValueString($_POST['comp_add1'], "text"),
                           GetSQLValueString($_POST['comp_add2'], "text"),
                           GetSQLValueString($_POST['comp_add3'], "text"),
                           GetSQLValueString($_POST['comp_city'], "text"),
                           GetSQLValueString($_POST['comp_postcode'], "text"),
                           GetSQLValueString($_POST['comp_tel'], "text"),
                           GetSQLValueString($_POST['comp_fax'], "text"),
                           GetSQLValueString($_POST['comp_email'], "text"),
                           GetSQLValueString($_POST['comp_web'], "text"),
                           GetSQLValueString($_POST['comp_description'], "text"),
                           GetSQLValueString($_POST['honors_awards'], "text"),
                           GetSQLValueString($_POST['industry'], "text"),
                           GetSQLValueString($_FILES['ufile']['name'], "text"),
                           GetSQLValueString($_POST['bul1'], "text"),
                           GetSQLValueString($_POST['bul2'], "text"),
                           GetSQLValueString($_POST['bul3'], "text"),
                           GetSQLValueString($_POST['bul4'], "text"),
                           GetSQLValueString($_POST['bul5'], "text"),
                           GetSQLValueString($_POST['bul6'], "text"),
                           GetSQLValueString($_POST['user'], "int"));
      mysql_select_db($database_db, $db);
      $Result1 = mysql_query($updateSQL, $db) or die(mysql_error());
      $updateGoTo = "home.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $updateGoTo));
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "update_business")) {
      $updateSQL = sprintf("UPDATE users SET photo=%s WHERE user_id=%s",
                           GetSQLValueString($_FILES['ufile']['name'], "text"),
                           GetSQLValueString($_POST['user'], "int"));
      mysql_select_db($database_db, $db);
      $Result1 = mysql_query($updateSQL, $db) or die(mysql_error());
    //define a maxim size for the uploaded images in Kb
    define ("MAX_SIZE","50000");
    //This function reads the extension of the file. It is used to determine if the file  is an image by checking the extension.
    function getExtension($str) {
             $i = strrpos($str,".");
             if (!$i) { return ""; }
             $l = strlen($str) - $i;
             $ext = substr($str,$i+1,$l);
             return $ext;
    //This variable is used as a flag. The value is initialized with 0 (meaning no error  found) 
    //and it will be changed to 1 if an errro occures. 
    //If the error occures the file will not be uploaded.
    $errors=0;
    //checks if the form has been submitted
    if(isset($_POST['Submit']))
         //reads the name of the file the user submitted for uploading
         $image=$_FILES['ufile']['name'];
         //if it is not empty
         if ($image)
         //get the original name of the file from the clients machine
             $filename = stripslashes($_FILES['ufile']['name']);
         //get the extension of the file in a lower case format
              $extension = getExtension($filename);
             $extension = strtolower($extension);
         //if it is not a known extension, we will suppose it is an error and will not  upload the file, 
        //otherwise we will do more tests
    if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif"))
            //print error message
                 echo '<h1>Unknown extension!</h1>';
                 $errors=1;
             else
    //get the size of the image in bytes
    //$_FILES['image']['tmp_name'] is the temporary filename of the file
    //in which the uploaded file was stored on the server
    $size=filesize($_FILES['ufile']['tmp_name']);
    //compare the size with the maxim size we defined and print error if bigger
    if ($size > MAX_SIZE*1024)
        echo '<h1>You have exceeded the size limit!</h1>';
        $errors=1;
    //we will give an unique name, for example the time in unix time format
    //$image_name=time().'.'.$extension;
    //the new name will be containing the full path where will be stored (images folder)
    $newname="company_pics/".$image;
    //we verify if the image has been uploaded, and print error instead
    $copied = copy($_FILES['ufile']['tmp_name'], $newname);
    if (!$copied)
        echo '<h1>Copy unsuccessfull!</h1>';
        $errors=1;
    //If no errors registred, print the success message
    if(isset($_POST['Submit']) && !$errors)
         echo "<h1>File Uploaded Successfully!</h1>";
    <label>Upload Photo</label><br />
    <input name="ufile" type="file" id="ufile" size="50" />
    <br /><br />

    Well I'm a newbie at OAS Portal so I used the Form based on a table and there in the FILE_ field I changed it from textbox to File Upload(binary), and then I ran the form and I filled all the textbox and then chose the file I wanted to upload I clicked on insert, then the row was inserted and then I tried to open the file but nothing happened!
    =(
    so probably is that the form is trying to save the file directly in the database right... so I must change the field type... right??

  • JSP : latest  JSTL, File Upload from web form Client to Server Question!

    I understand that within a JSP, It is possible to read a file from the Client by opening a Stream somehow.
    How do I code, within jsp/servlet (non tag) java code inside <% %>
    blocks, WITHOUT openening a new connection to the URL, an InputStream from a client web browser form, from a file upload coded using
    <input type="file" name="file1"/> ?
    I have previously achieved this quite simply with a FileInputStream
    with the previous version of JSTL.
    How may I do this with the latest version of JSTL, with this index.jsp?
    -with a simple text file.
    -with a Binary file (with DataInputStream)?
    <%--
    Document : index
    Created on : 27/01/2009, 3:08:32 PM
    Author : Zachary Mitchell
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1 align="center">Hello World!</h1>
    <form name="form1" method ="POST" >
    <table align="center">
    <tr>
    <td>
    <input name="file1" type="file" align="center"></input>
    </td>
    </tr>
    <tr>
    <td>
    <input type="submit" value="submit" action="index.jsp" ></input>
    </td>
    </tr>
    </table>
    </form>
    <!--*********************************************************************** -->
    <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
    <%@page import = "java.io.*" %>
    <c:if test="${pageContext.request.method=='POST'}">
    <%
    File fileName = new File(request.getParameter("file1"));
    out.println(fileName.toString());
    FileInputStream stream = new FileInputStream(fileName);
    out.println(stream.toString());
    %>
    </c:if>
    <!--*********************************************************************** -->
    </body>
    </html>

    If I have:
    <!-- ***********************************************************************************-->
    <form name="form1" method="POST" enctype="multipart/form-data">
    <input name="file1" type="file"/>
    <input name="submit1" type="submit" value="Submit" action="index.jsp"/>
    </form>
    <!-- ***********************************************************************************-->
    and run this in an index.jsp, use browse to select my text file, and click SUBMIT.
    I can use:
    InputStreamReader reader = new InputStreamReader(new DataInputStream(request.getInputStream()))
    BufferedReader bufferedReader = new BufferedReader(reader);
    bufferedReader.readLine();...
    However, these is some HTML/POST related content around what multiple readLine();
    calls return.
    Is there an easy way, like using "${param.file1}",
    aside from [http://commons.apache.org/fileupload/|http://commons.apache.org/fileupload/],
    maybe using servlet style code, to get the File contents from a remote Client,
    to the remote Server servlet engine, AVOIDING ANY SUPERFLUOUS CONTENT,
    using version 1.12 of the JSTL, JSP 2.0,Tomcat 6?
    Just politely, yes, no, and how?
    Edited by: Zac1234 on Jan 29, 2009 3:27 AM
    Edited by: Zac1234 on Feb 1, 2009 8:29 PM

  • Update File Upload Field

    Hi
    I have a file upload function in a "Update Record" form. I don't need to add new entries into the DB for each upload so I set the update to entered value 1.
    However on updating the record the file uploaded to the selected folder is deleted. Is it possible to update the same table field but not have the file deleted.
    If I upload fileA and then update id field 1 to upload fileB I do not want to delete fileA when I update id 1
    I hope that makes sense
    L

    Hi Albert
    I can't find any delete triggers in the code.
    ****CODE***
    //start Trigger_FileUpload trigger
    //remove this line if you want to edit the code by hand
    function Trigger_FileUpload(&$tNG) {
    $uploadObj = new tNG_FileUpload($tNG);
    $uploadObj->setFormFieldName("sfile_path");
    $uploadObj->setDbFieldName("sfile_path");
    $uploadObj->setFolder("../onlinemembership/supportdocs/");
    $uploadObj->setMaxSize(2000);
    $uploadObj->setAllowedExtensions("pdf, doc, txt");
    $uploadObj->setRename("auto");
    return $uploadObj->Execute();
    //end Trigger_FileUpload trigger
    // Make an update transaction instance
    $upd_support_file = new tNG_update($conn_DB_ACCESS);
    $tNGs->addTransaction($upd_support_file);
    // Register triggers
    $upd_support_file->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
    $upd_support_file->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
    $upd_support_file->registerTrigger("END", "Trigger_Default_Redirect", 99, "file2-test.php");
    $upd_support_file->registerTrigger("AFTER", "Trigger_FileUpload", 97);
    // Add columns
    $upd_support_file->setTable("support_file");
    $upd_support_file->addColumn("sfile_path", "FILE_TYPE", "FILES", "sfile_path");
    $upd_support_file->setPrimaryKey("sfile_ID", "NUMERIC_TYPE", "VALUE", "1");
    // Execute all the registered transactions
    $tNGs->executeTransactions();
    ****END****
    Thanks
    L

  • File upload in dynamic form

    Hi,
    I have a requirement to create a dynamic form. the input fields for the form come from a database query, and i will be getting back results like:
    input field name data type
    field1 text
    field2 select
    field3 attachment
    I am facing an issue with the attachment type of fields.
    i have tried creating my dynamic form using two different approaches -
    1. use the APEX_ITEM apis
    2. use htp.p to just output html from a pl/sql anonymous block.
    in both the cases, we do not have options to create a file input, not atleast directly.
    Can some one guide me on any existing solutions or approaches to this problem ?
    Note: i would prefer a solution based on the 2nd approach (using htp.p) since it gives me more flexibility with the other handlings.
    APEX_UTIL also doesn't have open APIs for file create, and i also found the radiogroup API not very friendly (did nt get it to work since i moved on to the other approach)
    Regards,
    Ramakrishnan

    Hi, if you want to submit your files, you will need hidden file upload objects in your page. One for each files, so you need to set a limit because you won't be able to submit hundreds of files anyway. Lets say between 5 to 10. Each hidden file upload will have one computation to put the data that will be sent to the server.
    iBEGIN
    IF wwv_flow.g_f01.COUNT > 0
    THEN
    RETURN wwv_flow.g_f01 (1);
    ELSE
    RETURN NULL;
    END IF;
    END;
    Then the only other things you need is an acceptation branching.
    You don't need a process to send those files. When your reload your page, a process should remove the file from APEX_APPLICATION_FILES table to your target table.
    It's Denes Kubicek's solution ! I suggest you to visit his demo website !

  • How do I reference a field in form portlet?

    I created a simple form portlet in Oracle Portal using the wizard.
    I want to execute a custom pl/sql query using simple select statement. (e.g. select emp from scott where ...)
    I created a new Button item.
    In the PL/SQL Button Event Handler I put the select statement.
    Now I have 2 questions.
    Question 1. Do I have to use the Query or Custom button.
    Question 2. In either way I get PLS-00428: an INTO clause is expected in this SELECT statement.
    I guess the fundamental question here is how do I reference a field in the form?

    If I understand you correctly you want to click on the button and then display a value selected from the database, right?
    1. You have to use the Custom button - query is exclusive for the form query.
    2. You will have to select the value into an interim PL/SQL variable and then set the form field using the portal session attribute.
    The following principles apply:
    * To set a field you have to use code like
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_RFS_ID',
    p_value => 30);
    p_session.save_session;
    where
    - p_session is available in most custom PL/SQL blocks - I'm not sure if its in the custom block for a button - this type of code is used mostly in the "cusom pl/sql before form is displayed" (last tab) - if its not available you might have to jump through some more hoops !:). It refers to a portal stored session that is used to store all the internal variables.
    - block_name is either DEFAULT for simple forms or MASTER or DETAIL for master/detail forms
    - p_attribute_name is the name of the field you want to set BUT (very important) prefixed with A_
    - p_value is the actual value - here you will use your pl/sql variable.
    so try something like:
    l_number number;
    select anumber into l_number from atable where ....;
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_field1',
    p_value => l_number);
    p_session.save_session;

  • How to edit View based field in forms

    Hi All,
    I developed a Query-Find Form for Customer details.In main form(after querying) I have some fields where the data is coming from a View.All are non -editable fields,But I need to make one Particular field as editable.How can I make that field as editable?
    could anyone please give me any solution.
    Thank you in Advance.

    Hi;
    Please check Re: Field is not editable and see its helpful
    Regards
    Helios

Maybe you are looking for