Using File Browse to update stored file

Hi all,
I have a form with a File Browse item on it which is (surprisingly!) used to upload a file and associate with a record. The filename is stored in a varchar column in the table. This works fine when I create (INSERT) the initial record and I can retrieve the stored file just fine. However the problem I have is when I want to update the uploaded file. It seems the normal mechanisms for update / save requests don't apply to uploaded files. My other attributes get updated fine but the new uploaded filename is not reflected in the table.
I've put together a simple example of this on a when apex.oracle.com :
http://apex.oracle.com/pls/otn/f?p=40740
Which has two fields, a file name and an 'attribute'. Try as I might I can't update the file name although the attribute changes just fine.
Any suggestions will be much appreciated. I realise I may be missing something fundamental here and am more than happy to be enlightened.
FYI, the purpose for such functionality is to allow users of our system to store a photograph of themselves along with their details. This functionality is required to allow the photograph to be updated if required.
Thanks,
Steve

If i am not mistaking, using a file browser item type will not set the uploaded file (blob) in this item, to be processed in the standard processing on you're page.
In a recent project i wrote a stored procedure for handling with uploaded files. This procedure, which based on the filename ( Fnnnn/<filename> ) , select the uploaded content through apex_application_files, the location apex saves the files. and procedure outputted the file as a blob, which then can be used to insert/update in youre table
Hope this example code will help you:
procedure upload_bestand( p_file_name in varchar2
, p_file out nocopy blob
, p_filetype out nocopy varchar2 )
is
-- Cursor voor bepalen bestand uit apex_application+files
cursor c_file ( b_file_name in varchar2)
is
select aaf.filename
, aaf.mime_type
, aaf.blob_content
from apex_application_files aaf
where aaf.name = b_file_name
r_file c_file%rowtype;
begin
open c_file ( b_file_name => p_file_name );
fetch c_file into r_file;
if c_file%notfound
then
-- Upload van bestand niet geslaagd
close c_file;
raise e_file_err;
end if;
close c_file;
-- Geupload bestand uit temp_upload tabel verwijdern
delete from apex_application_files
where name = p_file_name
commit;
p_file := r_file.blob_content;
p_filetype := r_file.mime_type;
end upload_bestand;

Similar Messages

  • File Browser doesn't show files

    I am trying to pull some of my pictures from my Media Hub but can't seem to do it.
    All of the pictures show in the Home view but when I go the the File Browser...no files show up in the folders. The folders are on the left but when I click to open any of them there is nothing in them. 
    I have checked my settings but can't figure out what I am doing wrong....

    Check under the "import" folder in the file browser, your pictures might be stored there if you used the import tool.
    Cheers.

  • File browse functionality for all files within a directory

    I have an app where you use file browse to select a file on the file system. Then, I parse the file name to determine other attribution to record in database, which may result in more user interaction before creating the database record.
    So, currently users can do this one file at a time. Anything available to let me loop through all files within a user-specified directory?
    Thanks,
    Steve

    I have an app where you use file browse to select a file on the file system. Then, I parse the file name to determine other attribution to record in database, which may result in more user interaction before creating the database record.
    So, currently users can do this one file at a time. Anything available to let me loop through all files within a user-specified directory?
    Thanks,
    Steve

  • Using  File Browse Item To Get File Only

    Is it possible to use the file browse item to just get the file without inserting it anywhere?
    I'm looking to allow a user to "upload" a file from their client machine... but what will actually happen in the process is it will take the file and send it in an e-mail to whomever needs to get it.
    Or is the only way to allow it to insert the file, do what I need to do with it, and then immediately delete it?
    Thanks,
    Chad

    Hello Chad,
    Please check if the following can help you - Using the file browser. .
    Regards,
    Arie.

  • Newb needs help opening file browser and getting full file name and path.

    Ok, so I'm a TOTAL newb here, but I have managed to get it to open a file browser but all I can seem to get it to do is give me the NAME of the selected file *eg. selectedFile.name* I also need the path of the file as in C:\example\file.mp3.
    The program I'm making plays an MP3 of your choice at a certain time, like an alarm clock. But I got tired of entering the file path of the MP3 EACH time so I wanted to have a browse feature.
    Ideas... help... thanks...
    Nicholas

    you'll need to use air to get the path.

  • File browser to find large files?

    I am looking for a program or file browser in order to locate large folders,files,etc on my hard drive. There is a program I have used in windows called ExplorerXP and there are many like it in the windows world. My available free disk space isn't adding up to me so I would like to see where it is being allocated.
    Thanks!

    Try WhatSize.

  • Why does Illustrator CC2014 write temporary files instead of updating existing file?

    Illustrator CC 2014 (Win) keeps saving temporary files rather than overwriting an existing file. This results in illustrations not showing as updated in InDesign. The only way round it is to use the Save As command — and that doesn't always work! Also, upon closing a window tab, it frequently changes text in the illustration to default Myriad Pro, without any input from me. I have to undo text changes to make it revert to the intended font.
    I've worked with every version of Illustrator since version 5.0 and this is the first time I've experienced such an apparent glitch. Any ideas why this should be happening top me?
    Nick
    Using: Adobe Creative Suite - Windows 7 Ultimate

    As explained before, when closing a tab, an open *.eps file suddenly acquires the changed asterisk, and when I go that tab it says under Edit "Undo Type Style". Yet, I can't see any change, even when I toggle between "Undo" and "Redo". also, under "Find Font", I can't find any other font other than the branded Interstate font, even though the current font selection window shows Myriad Pro.
    So, on to some serious detective work. I remembered back from the old days that *.eps files can be opened (and manipulated!) using Notepad.
    I saved the file (Figure 8) which said a change had taken place and compared that file with the original by opening in Notepad, copying and pasting into Word and using the latter's compare function. Obviously there are pages and pages to look through, but then I had a Eureka moment! This was what I found:
    dup /FontName get exch definefont pop
    end
    %ADOEndSubsetFont
    /COGQMXCOGQMV+XXXXXXInterstate-Light /XXXXXXInterstate-Light findfont ct_VMDictPut
    /COGQMXCOGQMV+XXXXXXInterstate-Light*1
    [32{/.notdef}rp /space 13{/.notdef}rp /period /.notdef /zero /one /two
    /.notdef /four 3{/.notdef}rp /eight /.notdef /colon /semicolon 9{/.notdef}rp
    /E /F 2{/.notdef}rp /I 9{/.notdef}rp /S /T 12{/.notdef}rp
    /a /b /c /d /e /f /g /h
    /i 2{/.notdef}rp /l /m /n /o /p /.notdef
    /r /s /t /u 138{/.notdef}rp]
    COGQMXCOGQMV+XXXXXXXInterstate-Light nf
    COGQMXCOGQMV+XXXXXXXInterstate-Light*1 [8.8569 0 0 -9 0 0 ]msf
    3.25928 10.4355 mo
    (Figure 8)
    I have used the XXXXXX to protect my client's anonymity, but the crossed out coding "/COGQMX" is to be found in the unchanged file, and the COGQMV in the changed file!
    Although I have described this as a Eureka moment, I actually don't understand the problem, but I feel I have narrowed it down and Mike is right — it IS a font issue!!

  • File browsing and showing selected files in a datagrid? i'm missing something small... i hope

    I am currently allowing the user to browse and select multiple files. I'd like to display the selected files in a datagrid. Here's my code. What am I missing?
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                                         xmlns:s="library://ns.adobe.com/flex/spark"
                                                         xmlns:mx="library://ns.adobe.com/flex/mx">
      <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>
      <fx:Script>
                        <![CDATA[
                                  import mx.collections.ArrayCollection;
                                  public var Files:File;
                                  [Bindable]
                                  public var arrUploadFiles:Array;
                                  private function init():void
                                            arrUploadFiles = new Array()
                                            Files = new File(); 
                                            Files.addEventListener(FileListEvent.SELECT_MULTIPLE,onSelect_multiple_files); 
                                            Files.browseForOpenMultiple("Select Files to Send!!"); 
                                  public function onSelect_multiple_files(f_evt:FileListEvent):void
                                            for each(var tempF:File  in f_evt.files){ 
                                                      tempF.load(); 
                                                      arrUploadFiles.push(tempF);
                                                      trace (tempF.nativePath);
                        ]]>
      </fx:Script>
              <s:Button x="259" y="454" label="Browse for Files" click="init()"/>
              <s:DataGrid x="159" y="211" requestedRowCount="4">
      <s:columns>
      <s:ArrayList>
                                            <s:GridColumn dataField="dataField1" headerText="Column 1"></s:GridColumn>
                                            <s:GridColumn dataField="dataField2" headerText="Column 2"></s:GridColumn>
                                            <s:GridColumn dataField="dataField3" headerText="Column 3"></s:GridColumn>
      </s:ArrayList>
      </s:columns>
      <s:typicalItem>
                                  <fx:Object dataField1="Sample Data" dataField2="Sample Data" dataField3="Sample Data"></fx:Object>
      </s:typicalItem>
      <s:ArrayList>
                                  <fx:Object dataField1="data1" dataField2="data1" dataField3="data1"></fx:Object>
                                  <fx:Object dataField1="data2" dataField2="data2" dataField3="data2"></fx:Object>
                                  <fx:Object dataField1="data3" dataField2="data3" dataField3="data3"></fx:Object>
                                  <fx:Object dataField1="data4" dataField2="data4" dataField3="data4"></fx:Object>
      </s:ArrayList>
      </s:DataGrid>
    </s:WindowedApplication>

    Arrays do not send out change events so the DG doesn’t know you pushed things onto it.  If you used the DG’s dataProvider it will have wrapped the array in an ArrayCollection and will notice the changes.  There is a FileSystemDataGrid component by the way.

  • Looking for file browser for WordPerfect Graphic files

    I'm not sure which forum to post this to, but here is my question. I have many CD's of WordPerfect Clipart in WPG format from my old WordPerfect days in Windows (sigh, I miss it on my Mac). I am trying to find a file browser or viewer that will display the thumbnails for viewing. Many apps and the finder do this for standard graphic file formats but I can't find one for wpg graphics.
    I can convert one at a time with MacLink Plus but it is so slow and you really don't know what the file is until coverted.
    If you know of any app that will diaplay a series of thumbnails or a light table view of the files I would appreciate it.
    Thank you.

    You could download the free last version of WP for the Mac, open them in that and save each as PICT. A third-party utility, "MetaMacro", would do that on all files in a folder in one step. Links to the download, the necessary OS 8/9/Classic updater (also helpful on OS 7), and MetaMacro are at:
    http://groups.yahoo.com/group/wordperfectmac/
    G4 iMac   Mac OS X (10.4.6)  

  • Help!  Using GUI button to update text file

    Desperately needing help on the following:
    As you will see, I have created two classes - one for reading and writing to a text file on my hard drive, and one for the GUI with two buttons - Display and Update. The Display button works perfectly in that it displays text from a file path. The Update button, however, does not work correctly. I seek for the Update button to update any edits to the same exact text file I view using the Display button.
    Any help would be greatly appreciated. Thanks!
    Class TextFile
    import java.io.*;
    public class TextFile
        public String read(String fileIn) throws IOException
            FileReader fr = new FileReader(fileIn);
            BufferedReader br = new BufferedReader(fr);
            String line;
            StringBuffer text = new StringBuffer();
            while((line = br.readLine()) != null)
              text.append(line+'\n');
            return text.toString();
        } //end read()
        public void write(String fileOut, String text, boolean append)
            throws IOException
            File file = new File(fileOut);
            FileWriter fw = new FileWriter(file, append);
            PrintWriter pw = new PrintWriter(fw);
            pw.println(text);
            fw.close();
        } // end write()
    } // end class TextFileClass TextFileGUI
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class TextFileGUI implements ActionListener
        TextFile tf = new TextFile();
        JTextField filenameField = new JTextField (30);
        JTextArea fileTextArea = new JTextArea (10, 30);
        JButton displayButton = new JButton ("Display");
        JButton updateButton = new JButton ("Update");
        JPanel panel = new JPanel();
        JFrame frame = new JFrame("Text File GUI");
        public TextFileGUI()
            panel.add(new JLabel("Filename"));
            panel.add(filenameField);
            panel.add(fileTextArea);
            fileTextArea.setLineWrap(true);
            panel.add(displayButton);
            displayButton.addActionListener(this);
            panel.add(updateButton);
            updateButton.addActionListener(this);
            frame.setContentPane(panel);
            frame.setSize(400,400);
            frame.setVisible(true);
        } //end TextFileGUI()
        public void actionPerformed(ActionEvent e)
            if(e.getSource() == displayButton)
                String t;
                try
                    t = tf.read(filenameField.getText());
                    fileTextArea.setText(t);
                catch(Exception ex)
                    fileTextArea.setText("Exception: "+ex);
                } //end try-catch
            } //end if
            else if(e.getSource() == updateButton)
                try
                  tf.write(filenameField.getText());
                catch(IOException ex)
                    fileTextArea.setText("Exception: "+ex);
                } //end try-catch
            } //end else if
         } //end actionPerformed()
    } //end TextFileGUI

    Here's your working example.
    In my opinion u do not have to append \n when u reading the file
    Look the source, if u have some problem, please, ask me.
    Regards
    public class TextFileGUI implements ActionListener
    TextFile tf = new TextFile();
    JTextField filenameField = new JTextField(30);
    JScrollPane scrollPane = new JScrollPane();
    JTextArea fileTextArea = new JTextArea();
    JButton displayButton = new JButton("Display");
    JButton updateButton = new JButton("Update");
    JPanel panel = new JPanel();
    JFrame frame = new JFrame("Text File GUI");
    public static void main(String args[])
    new TextFileGUI();
    public TextFileGUI()
    panel.setLayout(new BorderLayout());
    JPanel vName = new JPanel();
    vName.setLayout(new BorderLayout());
    vName.add(new JLabel("Filename"), BorderLayout.WEST);
    vName.add(filenameField, BorderLayout.CENTER);
    panel.add(vName, BorderLayout.NORTH);
    scrollPane.setViewportView(fileTextArea);
    panel.add(scrollPane, BorderLayout.CENTER);
    fileTextArea.setLineWrap(true);
    JPanel vBtn = new JPanel();
    vBtn.setLayout(new FlowLayout());
    vBtn.add(displayButton);
    displayButton.addActionListener(this);
    vBtn.add(updateButton);
    updateButton.addActionListener(this);
    panel.add(vBtn, BorderLayout.SOUTH);
    frame.setContentPane(panel);
    frame.setSize(400, 400);
    frame.setVisible(true);
    } // end TextFileGUI()
    public void actionPerformed(ActionEvent e)
    if (e.getSource() == displayButton)
    String t;
    try
    t = tf.read(filenameField.getText());
    fileTextArea.setText(t);
    catch (Exception ex)
    ex.printStackTrace();
    else if (e.getSource() == updateButton)
    try
    tf.write(filenameField.getText(), fileTextArea.getText(), false);
    catch (IOException ex)
    ex.printStackTrace();
    } // end try-catch
    } // end else if
    } // end actionPerformed()
    } // end TextFileGUI
    class TextFile
    public String read(String fileIn) throws IOException
    String line;
    StringBuffer text = new StringBuffer();
    FileInputStream vFis = new FileInputStream(fileIn);
    byte[] vByte = new byte[1024];
    int vPos = -1;
    while ((vPos = vFis.read(vByte)) > 0)
    text.append(new String(vByte, 0, vPos));
    vFis.close();
    return text.toString();
    } // end read()
    public void write(String fileOut, String text, boolean append) throws IOException
    File file = new File(fileOut);
    FileWriter fw = new FileWriter(file, append);
    PrintWriter pw = new PrintWriter(fw);
    pw.println(text);
    fw.close();
    } // end write()
    } // end class TextFile

  • Load flat files in batch without storing files on application server

    Hi SDN-ers
    We would like to load flatfiles into BW in batch but .... and this is the tricky part, without storing the file on the application server. We are able to call remote function modules from outside the system so maybe we can attach the file as an internal table with a remote function call and post it in PSA. Anyone ever tried this ?
    Thanks,
    Hans

    Hi,
       I would suggest to upload the data in flat file in a Database table in BW and then
       create a generic extractor on top of it to load the data into Cube or ODS . In this
       way you will have a copy of the data in files.
    Regards,
    Prakash

  • [Solved] File browser that supports mixed files and directories

    Are there any file browsers that show files and directories together, in the way that macs do? Most of the time I like the seperated structure, but for some things I'd like to be able to sort by, say, date modified, and have all the newest files and directories together. I'm hoping I'm just overlooking an option somewhere (I'm using nemo now), but this is kind of a tricky thing to google.
    EDIT
    Just looked again and noticed the option, right there in front of me. Oops. Still, andyone happen to know how to make this a property of a single directory, and not global?
    Last edited by ce1984 (2014-04-25 02:05:16)

    ls - just don't use
    --group-directories-first

  • Htmldb page with 'File Browse' hang on submit change

    I have a htmldb page with 'File Browse' item. With File Browse empty, on pressing submit button with which has 'SQL UPDATE' action and returning to same page branch, the page hangs.
    It also happen on File Import page of htmldb application itself with File Browse.
    Anyone have the same problem or know why?

    I'm working with Sashisu on our problem and I wanted to give a few more details on what we've found.
    -We're using HTMLDB 1.6
    -The problem occurs only on pages with a file upload page item.
    -When clicking a link on one of the problem pages the browser will stick on retrieving the page for 1-2 minutes, then ultimately it will end in a page cannot be displayed error.
    -Sometimes the page will not hang and go directly to the page cannot be displayed error.
    -After encountering the error, clicking back to return to the page and then retrying the link will successfully load (and upload the file) the next page.
    -The problem only happens in IE 6.0. The submits work fine in FireFox.
    -Our development servers do not have this problem using the same HTMLDB code. The configuration between the servers on Development and Production is similar but not exact (we're working on finding the delta).
    -We did not have this problem on production until a recent code update.
    Thanks in advance,
    -John

  • File Browse item...

    Hi everyone,
    I need a help...I'm sure it's a piece of cake for most of you...but.
    First of all I must explaine a architecture of the our application.
    So, we have a APEX and application which is placed on Server_01 and the data which are on Server_02. Databases are connected with a database link.
    Well, in the apllication I use the item "File Browse" to get some file from the hard disk of local computer.
    By default the file is saved in wwv_flows_files ( view on table wwv_flow_file_objects$ ).
    I need to insert that file on the remote database ( Server_02 ) over database link in the BLOB datatype field.
    ...so, if someone have any solution or experience...
    thanks,
    Mzz

    Zlatko,
    If you follow the instructions in our primary how-to on this topic, specifically the part "Storing the Document in a Custom Table", I think you need to change the code just a bit to insert the row (with the blob) into the remote table over your database link (http://download-west.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm#CIHHEHCJ).
    Scott

  • File Browser capabilities for V1.6

    Hello,<br>
    I am using a File Browser to add/upload files to my reports just like the How To: Build File Upload/Download App. The reports are working fine and so are the files until I want to edit/update individual records. When the FETCH ROW is executed, all fields for that record are returned except for the File Browse field. My question is, can the File Browser be used to recall the file that was attached, so that the user can decide if they would like to edit/update that record with another file?
    <br>
    <br>
    Right now I have all the records fields returning data except for File Browser field that remains blank. When I click it, select a different file, then save, all the other fields are updated except for this one that continues to display the original attached file.
    <br>
    <br>
    The File Browser's setting are:<br>
    HTML Form Element Attributes:onchange="htmldb_item_change(this)"<br>
    Source Used:Always, replacing any existing value in session state<br>
    Source Type:Database Column<br>
    Maintain Session State:Per Session<br>
    Source value or expression:FILE_NAME<br><br>
    Thanks,<br>
    Leo

    Try this parameters....<PARAM NAME=cache_version VALUE=0.0.0.1><PARAM NAME=cache_option VALUE=Plugin><PARAM NAME=cache_archive VALUE=AnalyzerClient.jar>Comment first the ARCHIVE VALUE line parameter.Use this link for more information...http://java.sun.com/j2se/1.3/docs/guide/misc/appletcaching.html

Maybe you are looking for

  • How can I remove all photos from my iphone?

    How can I remove all photos from my iphone?

  • Need help identifying iBook cables

    My question should be easy to answer, but it's  about a 2002 A1005 G3/600 iBook . . .so maybe it's not that easy. I bought it on a whim . . .  brand new . . .  in late summer 2002 . . . loaded it with all the contemporary software I was relying on at

  • Batch Processing - Acrobat XI Pro - Freezed

    HI eveyone, I am trying to do Batch Processing in Acrobat XI Pro the same i do with Acrobat 9 PRO. What i aim to achieve is to Export the PDFs to PostScript but when working on a bigger volume ( more then 700 letters) it freezed up. Normally we are w

  • My usb cord won't connect to my macbook air

    Whenever I plug my phone into the USB cord and then into the Macbook Air, it won't connect! The phone vibrates and I can't sync music or photos! We replaced the Macbook and this is still happening, then we replaced the USB cord with one that we bough

  • Creating Import P.O.

    Hello Sirs,          I have to demonstrate the following scenario.          " There is a company in Dubai willing to import a medical equipment from France. For this scenario P.O. is to be created."          I have to create a P.O. for the above scen