Upload file in to file system using Apex

Hi...
I have tried UTL_FILE to upload file in Directory. But First i have to upload file in Table in BLOB datatype and then copy it to file system using BFILE.
I have to store files in file system as per requirements.
I want to upload file directly to File System. Suggest me the right way...
Thank You in advance........
Edited by: user639262 on Aug 28, 2008 2:11 PM

Apex only supports upload into a table.
If you want to upload directly to the file system you should look into the possibilities of your application server. Maybe you could find a piece of code in Java or PHP that performs an upload.
good luck, DickDral

Similar Messages

  • How can i do the upload file function using tomcat library??

    how can i do the upload file function using tomcat library??

    Did you read the document for the library?
    If you can't figure it out, why don't you ask the people who provide the library?
    This has nothing to do with JavaMail.

  • Trying to view Ipad file system using a computer running Windows 7?

    I'm trying to view my Ipad file system using my computer but i can only see the DCIM folder why is that?

    iDevices do not have an accessible file management system for security reasons.

  • Upload file without using file upload UI Element

    Hi all.
    I need upload a .txt file without using file upload UI Element because filename is not insert by user. The filename is generated by program. I try to use 'GUI_UPLOAD' and 'WS_UPLOAD' but don't work.
    Many thanks in advance.

    As you correctly pointed out we cannot use the gui_upload and gui_download fm's in webdynpro because they require sap gui and WD Components generally run in a HTML or Portal environment.
    The only option available is File Upload Element

  • All plugins uptodate but on upload file get "USING one of the supported browser with latest Adobe Flash is required to experience enhanced file upload features

    I am freelancer. When I tried to upload files on elance it give following error and disable the upload button:using one of the supported browser with latest Adobe flash is required to experience enhanced file upload features.
    All plugins are up to date. Flash version 11.7 installed.

    I assume Firefox 19 worked fine on the site?
    Some sites may be mistakenly identifying Firefox 20 as Firefox 2, which is a very old version they probably no longer support. As a test, you could "lie" to the site about your Firefox version and see whether that little deception works.
    This take a minute to set up. Here's how:
    (1) Select and copy the following preference name to the clipboard:
    general.useragent.override.elance''.''com
    (2) In a new tab or window, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (3) In the filter box, type '''override''' and pause while the list is filtered
    (4) Make sure '''general.useragent.site_specific_overrides''' is set to its default value of true (or right-click and choose Reset if it is not).
    (5) Right-click anywhere in the preference list area and choose
    New > String
    then paste the preference name you copied. Click OK and enter TEMP or asdf or any text as a temporary placeholder. You should see the preference added in bold. Leave about:config open and switch back to this tab.
    (6) Select and copy the following useragent string to the clipboard ''(it's all one line)'':
    Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0
    (That's Firefox 19 on Windows 7 32-bit)
    (7) In about:config, double-click '''general.useragent.override.elance''.''com''' and paste to replace the temporary text with the new useragent string. Click OK, you're done here.
    Now try reloading a page where you need to upload (use Ctrl+Shift+r) and test that function again. Any change?

  • File system used space monitoring rule

    All, I'm trying to change the way OC monitors disk space usage. I don't want it to report on nfs filesystems, except from the server from which they are shared.
    The monitored attribute is FileSystemUsages.name=*.usedSpacePercentage.
    I'd like it to only report on ufs and zfs filesystems. I've tried to create new rules using the attribures:
    FileSystemUsages.type=ufs.usedSpacePercentage
    FileSystemUsages.type=UFS.usedSpacePercentage
    FileSystemUsages.type=zfs.usedSpacePercentage
    FileSystemUsages.type=ZFS.usedSpacePercentage
    But I don't get any alerts generated on system which I know violate the thresholds I've specified.
    Has anybody successfully set up rules like these? Am I on the right track? do ufs/UFS/zfs/ZFS need to be single or double quoted? Documentation with various examples is non-existent as far as I can tell.
    Any help is greatly appreciated
    Tim

    do you get any answers for this question? It seems like OEM12c has file system space usage monitoring setup for nfs mounted file systems, however I could not find a place to specify the threshold for those nfs mounted file sytems except root file system. does anybody know how to setup threshold of nfs mounted file systems(Netapp storage)? thank you very much

  • Want to access network file system using JFileChooser

    Hi all,
    I want to access and display the drives of a network file system in the JFileChooser dialog. For example by specifying a machine name, I want to access the drives(C, E, F....) of that machine. Can anyone please guide me on how to go forward with this.
    Thanks in advance

    Any links or guidance provided would bhi helpful

  • How do I open a word document held on a file system within APEX

    I am trying to open a variety of documents, word, excel and pdf from within apex. The file locations are stored in a table so the users can click on a link and the document will open, apex just appears to fail even when attempting to open in a new window.
    Any help please!

    Assuming you already have the files loaded in to a blob, the following sql is used in a tabular report:
    select NAME , CREATED_BY, CREATED_DATE ,doc_id, description,
    '^a href="download_file?p_doc_id=' || doc_id ||'" target="_blank"><img src="/i/download.gif"></a^' download
    from DOCS where doc_id=:p2_doc_id
    ****NOTE*****
    the forum code is trying to process my link example in the sql statement above. Replace the two "^" with "<" and ">" to start and end the code segment.
    ****NOTE*****
    It uses the following proc to extract the blob from the table.
    CREATE OR REPLACE PROCEDURE download_file(p_doc_id IN number) AS
    v_mime VARCHAR2(48);
    v_length NUMBER;
    v_file_name VARCHAR2(2000);
    v_Lob_loc BLOB;
    BEGIN
    SELECT MIME_TYPE, doc_CONTENT, name,DBMS_LOB.GETLENGTH(doc_content)
    INTO v_mime,v_lob_loc,v_file_name,v_length
    FROM docs
    WHERE doc_id = p_doc_id;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( nvl(v_mime,'application/octet'),
    FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment; filename="'||replace(REPLACE(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),NULL),chr(13),NULL)|| '"');
    -- use inline if you want file to open without asking. It opens in the current browser window
    --htp.p('Content-Disposition: inline; filename="'||replace(REPLACE(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),NULL),chr(13),NULL)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( v_Lob_loc );
    end download_file;
    Edited by: ABD - DBA on Aug 5, 2010 8:30 AM
    Edited by: ABD - DBA on Aug 5, 2010 8:30 AM
    Edited by: ABD - DBA on Aug 5, 2010 8:32 AM

  • Upload file without using upoad ui elem

    HI,
    I have requirement where in I will have the file links in the table.On selecting the file link and clicking on a button,
    file content should be uploaded.
    e.g. I have file lins as 1) c:/docs/test.doc
                                       2)c:/docs/test2.doc.
    When I select the first file and click upload i shouild get the xstring content of the file. I shouldnot use file upload Ui element.
    Is it possible to achieve the same.
    Regards,
    Madhu

    @Sheik
    no you can't this is web dynpro ABAP not GUI based ABAP - you don't have access to the GUI functionality.
    @Madhu
    You could use the [ACFUpDownload |http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b9157c878a2d67e10000000a42189c/frameset.htm] functionality - although you will need to explicitly allow for that file location in your whitelist (which could be tricky if it is very dynamic). And you'll need to consider how to distribute the whitelist (easier in 7.02).
    There is an example of this functionality in the WD component WD_TEST_APPL_ACFUPDOWN

  • File system using swing

    Hi,
    I am developing a standalone application using swing and awt. My requirement is to show directory structure like windows explorer. Do we have any built-in components in swing get this Done.
    Thanks
    mmb

    herez a sample code for you... not commented at all...
    import java.io.File;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.event.TreeExpansionEvent;
    import javax.swing.event.TreeWillExpandListener;
    import javax.swing.filechooser.FileSystemView;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.DefaultTreeModel;
    public class JExpTree extends JTree{
         FileSystemView fsv=null;
         File home=null;
         File[] temp=null;
         DefaultMutableTreeNode root=null;
         DefaultTreeModel treeModel=null;
         DefaultTreeCellRenderer treeRend=null;
         public JExpTree(){
              initialize();
              setModel(treeModel);
              setShowsRootHandles(true);
              addTreeWillExpandListener(new TreeWillExpandListener(){
                   public void treeWillCollapse(TreeExpansionEvent e){
                        ((DefaultMutableTreeNode)(e.getPath().getLastPathComponent())).removeAllChildren();     
                        ((DefaultMutableTreeNode)(e.getPath().getLastPathComponent())).add(new DefaultMutableTreeNode(null));     
                   public void treeWillExpand(TreeExpansionEvent e){
                        expandPath((DefaultMutableTreeNode)(e.getPath().getLastPathComponent()));
         public void expandPath(DefaultMutableTreeNode d){
              d.removeAllChildren();
              File[] tempf=((TreeFile)d.getUserObject()).getFile().listFiles();
              DefaultMutableTreeNode tempd=null;
              for(int i=0; i<tempf.length; i++){
                   tempd=new DefaultMutableTreeNode(new TreeFile(tempf));
                   if(tempf[i].isDirectory())
                        tempd.add(new DefaultMutableTreeNode(null));
                   d.add(tempd);
         public void initialize(){
              fsv=FileSystemView.getFileSystemView();
              root=new DefaultMutableTreeNode(new TreeFile(fsv.getHomeDirectory()));
              expandPath(root);
              treeModel=new DefaultTreeModel(root);
         public static void main(String a[]){
              JFrame j=new JFrame("TestFrame");
              j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              j.getContentPane().add(new JScrollPane(new JExpTree()));
              j.pack();
              j.setVisible(true);
    import java.io.File;
    import javax.swing.filechooser.FileSystemView;
    public class TreeFile {
         private File file=null;
         public TreeFile(File f){
              file=f;
         public File getFile(){
              return file;
         public String toString(){
              return FileSystemView.getFileSystemView().getSystemDisplayName(file);

  • Mounting a UFS file system using  NFS on Solaris 10

    Quick question: If I have a Solaris 10 server running ZFS can I just mount and read a UFS partition without any issues?

    NFS is filesystem agnostic.
    Your not mounting a UFS filesystem, you mounting an NFS filesystem.
    So the answer is yes.

  • How to get the machine id of a  system using apex

    Hi,
    I have a requirement to retrieve the machine id of a system through oracle apex. I have checked the syscontext() function also but i am not able to find the one for machine id. So, is there any way to retreive the machine id using a sql or plsql command in oracle apex.
    Thanks in Advance,
    Balaji.

    Best to ask that question on the APEX forum : this is the Oracle Forms forum

  • We can use JSR-168 JPS portlet upload file,

    We can use JSR-168 JPS portlet upload file,
    here is the source for you referrence:
    upload file can use JSR168 portlet,
    1,CustomizablePortlet.java File
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.ResourceBundle;
    import javax.portlet.*;
    import oracle.webdb.utils.SimpleStringBuffer;
    public class CustomizablePortlet extends GenericPortlet {
    private static final String TITLE_KEY = "title";
    protected static final String OK_ACTION = "ok_action";
    protected static final String APPLY_ACTION = "apply_action";
    protected static final PortletMode PREVIEW_MODE = new PortletMode("preview");
    protected static final PortletMode EDIT_DEFAULTS_MODE = new PortletMode("EDIT_DEFAULTS");
    protected static final PortletMode ABOUT_MODE = new PortletMode("ABOUT");
    public CustomizablePortlet() {
    public String getTitle(RenderRequest request) {
    return request.getPreferences().getValue("title", getPortletConfig().getResourceBundle(request.getLocale()).getString("javax.portlet.title"));
    public void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.print("<FORM ACTION=\"");
    out.print(getEditFormSubmitURL(request, response));
    out.println("\" METHOD=\"POST\">");
    out.println("<TABLE BORDER=\"0\">");
    out.println("<TR>");
    out.println("<TD WIDTH=\"20%\">");
    out.println("<P CLASS=\"portlet-form-field\" ALIGN=\"RIGHT\">Title:");
    out.println("</TD>");
    out.println("<TD WIDTH=\"80%\">");
    out.print("<INPUT CLASS=\"portlet-form-input-field\" TYPE=\"TEXT\" NAME=\"");
    out.print("title");
    out.print("\" VALUE=\"");
    out.print(getTitle(request));
    out.println("\" SIZE=\"20\">");
    out.println("</TD>");
    out.println("</TR>");
    out.println("<TR>");
    out.println("<TD COLSPAN=\"2\" ALIGN=\"CENTER\">");
    out.print("<INPUT CLASS=\"portlet-form-button\" TYPE=\"SUBMIT\" NAME=\"");
    out.print("ok_action");
    out.print("\" VALUE=\"OK\">");
    out.print("<INPUT CLASS=\"portlet-form-button\" TYPE=\"SUBMIT\" NAME=\"");
    out.print("apply_action");
    out.print("\" VALUE=\"Apply\">");
    out.println("</TD>");
    out.println("</TR>");
    out.println("</TABLE>");
    out.println("</FORM>");
    protected String getEditFormSubmitURL(RenderRequest request, RenderResponse response) {
    return response.createActionURL().toString();
    public void doHelp(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.print("Help for <i><b>");
    out.print(getTitle(request));
    out.println("</b></i>.");
    public void doAbout(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    String aboutHTML = (new SimpleStringBuffer(30)).append("/about_").append(getPortletName()).append(".html").toString();
    PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(aboutHTML);
    response.setContentType("text/html");
    if(rd != null) {
    rd.include(request, response);
    } else {
    PrintWriter out = response.getWriter();
    out.print("<p class=\"portlet-font\">This is the about page for ");
    out.print(getTitle(request));
    out.print(".</p><p class=\"portlet-font\">");
    out.print("To customize the contents of this page, create a file named '");
    out.print(aboutHTML.substring(1));
    out.print("' in the Portlet web application's root directory containing HTML ");
    out.print("to appear here. ");
    out.print("Alternatively, override the <code>CustomizablePortlet</code> ");
    out.println("class's <code>doAbout()</code> method.</p>");
    public void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    WindowState state = request.getWindowState();
    if(!state.equals(WindowState.MINIMIZED)) {
    PortletMode mode = request.getPortletMode();
    if(mode.equals(PREVIEW_MODE))
    doView(request, response);
    else
    if(mode.equals(EDIT_DEFAULTS_MODE))
    doEdit(request, response);
    else
    if(mode.equals(ABOUT_MODE))
    doAbout(request, response);
    else
    super.doDispatch(request, response);
    } else {
    super.doDispatch(request, response);
    public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException {
    String newTitle = request.getParameter("title");
    PortletPreferences prefs = request.getPreferences();
    prefs.setValue("title", newTitle);
    prefs.store();
    if(request.getParameter("ok_action") != null) {
    actionResponse.setPortletMode(PortletMode.VIEW);
    actionResponse.setWindowState(WindowState.NORMAL);
    2,FileUploadPortlet.java file
    import java.io.*;
    import javax.activation.DataHandler;
    import javax.mail.MessagingException;
    import javax.mail.internet.MimeBodyPart;
    import javax.portlet.*;
    import oracle.portal.portlet.sample.CustomizablePortlet;
    public class FileUploadPortlet extends CustomizablePortlet
    private static final String FILE_PARAM = "file";
    private static final String SUBMIT_PARAM = "submit";
    private static final String DEFAULT_CHARSET = "ISO-8859-1";
    private static final String uploadRoot = "";
    public FileUploadPortlet()
    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.print("<form action=\"");
    out.print(response.createActionURL().toString());
    out.println("\" enctype=\"multipart/form-data\" method=\"post\">");
    out.println("<center><table border=\"0\">");
    out.println("<tr>");
    out.print("<td class=\"portlet-form-field\" align=\"right\">");
    out.print("Please browse to an HTML file:");
    out.println("</td>");
    out.print("<td>");
    out.print("<input class=\"portlet-form-input-field\" type=\"file\" name=\"");
    out.print("file");
    out.print("\">");
    out.println("</td>");
    out.println("</tr>");
    out.println("<tr>");
    out.println("<td colspan=\"2\" align=\"center\">");
    out.print("<input type=\"submit\" class=\"portlet-form-button\" name=\"");
    out.print("submit");
    out.print("\" value=\"Display\">");
    out.println("</td>");
    out.println("</tr>");
    out.println("</table>");
    out.println("</form>");
    String lastFile = request.getPreferences().getValue("file", null);
    if(lastFile != null) {
    out.println("<hr width=\"100%\"><br>");
    out.print(lastFile);
    public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException {
    FormDataParser parsedRequest = new FormDataParser(request);
    MimeBodyPart mbp = parsedRequest.getMimeBodyPart("file");
    if(mbp == null)
    super.processAction(request, actionResponse);
    else
    try {
    String fileName= mbp.getFileName();
    int splash = fileName.lastIndexOf("\\");
    if(splash != -1)
    fileName = fileName.substring(splash +1, fileName.length()).trim();
    String contentType = mbp.getContentType();
    String charSet = getCharsetFromContentType(contentType);
    int sepIndex = contentType.indexOf(';');
    if(sepIndex != -1)
    contentType = contentType.substring(0, sepIndex).trim();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    mbp.getDataHandler().writeTo(bos);
    bos.close();
    String content = new String(bos.toByteArray(), charSet);
    FileOutputStream fos = new FileOutputStream(fileName);
    fos.write(bos.toByteArray());
    fos.close();
    PortletPreferences prefs = request.getPreferences();
    prefs.setValue("file", fileName + "upload ok");
    prefs.store();
    catch(MessagingException me) {
    throw new PortletException(me);
    public static String getCharsetFromContentType(String contentType) {
    int lastPos;
    if((lastPos = contentType.indexOf(';')) == -1)
    return "ISO-8859-1";
    lastPos++;
    String lowerContentType = contentType.toLowerCase();
    int nextPos;
    do {
    nextPos = lowerContentType.indexOf(';', lastPos);
    String param;
    if(nextPos == -1)
    param = lowerContentType.substring(lastPos).trim();
    else
    param = lowerContentType.substring(lastPos, nextPos).trim();
    if(param.startsWith("charset=") && param.length() > 8)
    return param.substring(8);
    lastPos = nextPos + 1;
    } while(nextPos != -1);
    return "ISO-8859-1";
    3,FormDataParser.java file
    import java.io.*;
    import java.util.*;
    import javax.activation.DataSource;
    import javax.mail.MessagingException;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMultipart;
    import javax.portlet.ActionRequest;
    import javax.portlet.PortletException;
    public class FormDataParser {
    private static final String MULTIPART_PREFIX = "multipart/";
    private static final String MULTIPART_FORM_DATA = "multipart/form-data";
    private static final String PLAIN_TEXT = "text/plain";
    private ActionRequest mWrappedRequest;
    private Map mParams;
    private Map mBodyParts;
    private boolean mIsInitialized;
    private boolean mHasMultipart;
    public FormDataParser(ActionRequest request) {
    mWrappedRequest = request;
    public String getParameter(String name) throws PortletException {
    String value = mWrappedRequest.getParameter(name);
    if(value != null)
    return value;
    initParameters();
    if(!mHasMultipart)
    return null;
    List paramList = (List)mParams.get(name);
    if(paramList != null)
    return (String)paramList.get(0);
    else
    return null;
    public String[] getParameterValues(String name) throws PortletException {
    String values[] = mWrappedRequest.getParameterValues(name);
    if(!mHasMultipart)
    return values;
    initParameters();
    List valueList = (List)mParams.get(name);
    if(valueList == null)
    return values;
    int size = valueList.size();
    if(values != null) {
    List newValueList = new ArrayList(values.length + size);
    newValueList.addAll(Arrays.asList(values));
    newValueList.addAll(valueList);
    valueList = newValueList;
    values = new String[size];
    valueList.toArray(values);
    return values;
    public MimeBodyPart getMimeBodyPart(String name) throws PortletException {
    initParameters();
    if(!mHasMultipart) {
    return null;
    } else {
    List parts = (List)mBodyParts.get(name);
    return parts != null ? (MimeBodyPart)parts.get(0) : null;
    public MimeBodyPart[] getMimeBodyParts(String name) throws PortletException {
    initParameters();
    if(!mHasMultipart)
    return null;
    List parts = (List)mBodyParts.get(name);
    if(parts == null) {
    return null;
    } else {
    MimeBodyPart mimeBodyParts[] = new MimeBodyPart[parts.size()];
    parts.toArray(mimeBodyParts);
    return mimeBodyParts;
    private void initParameters() throws PortletException {
    if(mIsInitialized)
    return;
    String contentType = mWrappedRequest.getContentType();
    if(contentType == null) {
    mIsInitialized = true;
    return;
    int sepIndex = contentType.indexOf(';');
    if(sepIndex != -1)
    contentType = contentType.substring(0, sepIndex).trim();
    if(contentType.equalsIgnoreCase("multipart/form-data")) {
    mParams = new HashMap(20);
    mBodyParts = new HashMap(20);
    DataSource ds = new DataSource() {
    public InputStream getInputStream() throws IOException {
    return mWrappedRequest.getPortletInputStream();
    public OutputStream getOutputStream() throws IOException {
    throw new IOException("OutputStream not available");
    public String getContentType() {
    return mWrappedRequest.getContentType();
    public String getName() {
    return getClass().getName();
    try {
    MimeMultipart multipartMessage = new MimeMultipart(ds);
    parseMultiPart(multipartMessage, null);
    catch(MessagingException me) {
    throw new PortletException(me);
    catch(IOException ioe) {
    throw new PortletException(ioe);
    mHasMultipart = true;
    mIsInitialized = true;
    private void parseMultiPart(MimeMultipart multipartMessage, String parentFieldName) throws MessagingException, IOException {
    int partCount = multipartMessage.getCount();
    for(int i = 0; i < partCount; i++) {
    javax.mail.BodyPart part = multipartMessage.getBodyPart(i);
    if(part instanceof MimeBodyPart) {
    MimeBodyPart mimePart = (MimeBodyPart)part;
    String disps[] = mimePart.getHeader("Content-Disposition");
    if(disps != null && disps.length != 0) {
    String disp = disps[0];
    String lcDisp = disp.toLowerCase();
    int nameStart;
    int nameEnd;
    if((nameStart = lcDisp.indexOf("name=\"")) != -1 && (nameEnd = lcDisp.indexOf("\"", nameStart + 6)) != -1)
    parentFieldName = disp.substring(nameStart + 6, nameEnd);
    if(parentFieldName != null)
    if(mimePart.getContentType().toLowerCase().startsWith("multipart/")) {
    Object content = mimePart.getContent();
    if(content instanceof MimeMultipart)
    parseMultiPart((MimeMultipart)content, parentFieldName);
    } else
    if((nameStart = lcDisp.indexOf("filename=\"")) != -1 && (nameEnd = lcDisp.indexOf("\"", nameStart + 10)) != -1) {
    List values = (List)mBodyParts.get(parentFieldName);
    if(values == null) {
    values = new ArrayList(1);
    mBodyParts.put(parentFieldName, values);
    values.add(mimePart);
    } else
    if(mimePart.getContentType().toLowerCase().startsWith("text/plain")) {
    Object content = mimePart.getContent();
    if(content instanceof String) {
    List values = (List)mParams.get(parentFieldName);
    if(values == null) {
    values = new ArrayList(1);
    mParams.put(parentFieldName, values);
    values.add((String)content);
    4.web.xml file
    <?xml version = '1.0' encoding = 'ISO-8859-1'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>hanhuiwen OracleSamplePortlets</display-name>
    <description>hanhuiwen Oracle Sample Portlet Application</description>
    <servlet>
    <servlet-name>portletdeploy</servlet-name>
    <servlet-class>oracle.webdb.wsrp.server.deploy.PortletDeployServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>portletjaxrpc</servlet-name>
    <servlet-class>com.sun.xml.rpc.server.http.JAXRPCServlet</servlet-class>
    <init-param>
    <param-name>configuration.file</param-name>
    <param-value>/WEB-INF/WSRPService_Config.properties</param-value>
    </init-param>
    </servlet>
    <servlet>
    <servlet-name>portletresource</servlet-name>
    <servlet-class>oracle.webdb.wsrp.server.ResourceServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>ChartServlet</servlet-name>
    <display-name>Chart Servlet</display-name>
    <description>Demo image-generating servlet</description>
    <servlet-class>oracle.portal.portlet.sample.chart.ChartServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>uix</servlet-name>
    <servlet-class>oracle.cabo.servlet.UIXServlet</servlet-class>
    <init-param>
    <param-name>oracle.cabo.servlet.pageBroker</param-name>
    <param-value>oracle.cabo.servlet.xml.UIXPageBroker</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>ChartServlet</servlet-name>
    <url-pattern>/chart*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>portletjaxrpc</servlet-name>
    <url-pattern>/portlets*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>portletresource</servlet-name>
    <url-pattern>/portletresource*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>uix</servlet-name>
    <url-pattern>*.uix</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>uix</servlet-name>
    <url-pattern>/uix/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>60</session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>index.uix</welcome-file>
    </welcome-file-list>
    <!--
    LogLevel controls the amount of information logged. There are 7 log levels:
    0 - logging disabled
    1 - configuration
    2 - severe error
    3 - warning
    4 - throwing exception
    5 - performance
    6 - information
    7 - debug
    The oracle.portal.log.Logger interface defines methods that map to these 7
    log levels. However, there are also 2 methods that do not map to log
    levels. These methods are included for backwards compatibility and data
    logged using these methods will always be logged regardless of the log level.
    -->
    <env-entry>
    <env-entry-name>oracle/portal/log/logLevel</env-entry-name>
    <env-entry-type>java.lang.Integer</env-entry-type>
    <env-entry-value>7</env-entry-value>
    </env-entry>
    </web-app>
    5.portlet.xml
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
    <portlet>
    <description xml:lang="en">A portlet that demonstrates the file upload features of the Java Portlet Specification.</description>
    <portlet-name>FileUpload</portlet-name>
    <portlet-class>FileUploadPortlet</portlet-class>
    <expiration-cache>0</expiration-cache>
    <supports>
    <mime-type>text/html</mime-type>
    <portlet-mode>help</portlet-mode>
    <portlet-mode>about</portlet-mode>
    <portlet-mode>edit_defaults</portlet-mode>
    </supports>
    <supported-locale>en</supported-locale>
    <portlet-info>
    <title>File Upload Portlet</title>
    <short-title>File Upload</short-title>
    <keywords>File,Upload, Portlet</keywords>
    </portlet-info>
    </portlet>
    <custom-portlet-mode>
    <description xml:lang="en">This mode should be used by the portlet to display information on the portlet's purpose, origin, version, etc.</description>
    <portlet-mode>about</portlet-mode>
    </custom-portlet-mode>
    <custom-portlet-mode>
    <description xml:lang="en">This mode signifies that the portlet should render a screen to set the default values for the modifiable preferences that are typically changed in the EDIT screen. Calling this mode requires that the user must have administrator rights.</description>
    <portlet-mode>edit_defaults</portlet-mode>
    </custom-portlet-mode>
    <custom-portlet-mode>
    <description xml:lang="en">This mode should be used by the portlet to render output without the need of having back-end connections or user specific data available.</description>
    <portlet-mode>preview</portlet-mode>
    </custom-portlet-mode>
    <user-attribute>
    <name>user.name.given</name>
    </user-attribute>
    <user-attribute>
    <name>user.name.family</name>
    </user-attribute>
    <user-attribute>
    <name>user.name.middle</name>
    </user-attribute>
    <user-attribute>
    <name>user.name.nickname</name>
    </user-attribute>
    <user-attribute>
    <name>user.bdate</name>
    </user-attribute>
    <user-attribute>
    <name>user.business-info.online.email</name>
    </user-attribute>
    </portlet-app>

    Hello i had exactly the same error, but not with file upload.
    I'm sure you have in your application lib directory to jars which aren't compatible to each other.
    And the problem occured between my myfaces and tomahawk jars .
    See this page:
    http://wiki.apache.org/myfaces/CompatibilityMatrix
    It tells you which myfaces and tomahawk jars you can use together.
    Hope it can help.
    bye

  • Store \ Retrieve files from file system

    Hi to all!
    I would like to implement a solution for storing files uploaded via apex user interface to servers file system. As well I would like this files to be retrievable by apex users. I designed the following solution:
    For upload:
    1. Through file browse item user chooses file to be uploaded
    2. File goes to custom table (as BLOB)
    -- so far i would use apex Upload\Download files tutorial
    3. File(BLOB) would then have to be written to file system to some directory and file id would have to be written to some db table which holds pointers to files on file system
    4. delete file(blob) from custom table (from step 2)
    For download:
    1. user chooses link from some report region(based on table giving file pointers to files residing on file system)
    2. file identified with chosen file pointer is then inserted into blob column of some custom table in db
    3. from custom table with download procedure fie is finally presented to user
    4. delete file(blob) from custom table (from step 2)
    Using apex tutorial for Upload\Download files it is straitforward to get the files from db table or into db table using blobs. But i have not seen any example of using BFILE or migrating files from db to file system and vice versa.
    So some Q arise:
    a) How can I implement step 3 under For upload section above
    b) How can I implement step 2 under For download section above
    c) Is there any way to directly upload file to file system via apex user interface or to directly download file from file system via some report region link column?
    Please help!!!
    Regards Marinero
    Message was edited by:
    marinero

    marinero,
    Here is a procedure that will copy an uploaded file to the file system:
      Procedure BLOB_TO_FILE(p_file_name In Varchar2) Is
        l_out_file    UTL_FILE.file_type;
        l_buffer      Raw(32767);
        l_amount      Binary_Integer := 32767;
        l_pos         Integer := 1;
        l_blob_len    Integer;
        p_data        Blob;
        file_name  Varchar2(256);
      Begin
        For rec In (Select ID
                              From HTMLDB_APPLICATION_FILES
                             Where Name = p_file_name)
        Loop
            Select BLOB_CONTENT, filename Into p_data, file_name From HTMLDB_APPLICATION_FILES Where ID = rec.ID;
            l_blob_len := DBMS_LOB.getlength(p_data);
            l_out_file := UTL_FILE.fopen('UPDOWNFILES_DIR', file_name, 'wb', 32767);
            While l_pos < l_blob_len
            Loop
              DBMS_LOB.Read(p_data, l_amount, l_pos, l_buffer);
              If l_buffer Is Not Null Then
                UTL_FILE.put_raw(l_out_file, l_buffer, True);
              End If;
              l_pos := l_pos + l_amount;
            End Loop;
            UTL_FILE.fclose(l_out_file);
        End Loop;         
      Exception
        When Others Then
          If UTL_FILE.is_open(l_out_file) Then
            UTL_FILE.fclose(l_out_file);
          End If;
      end; And here is a procedure that will download a file directly from the file system:
      Procedure download_my_file(p_file In Number) As
        v_length    Number;
        v_file_name Varchar2(2000);
        Lob_loc     Bfile;
      Begin
        Select file_name
          Into v_file_name
          From UpDownFiles F
         Where File_id = p_file;
        Lob_loc  := bfilename('UPDOWNFILES_DIR', v_file_name);
        v_length := dbms_lob.getlength(Lob_loc);
        owa_util.mime_header('application/octet', False);
        htp.p('Content-length: ' || v_length);
        htp.p('Content-Disposition: attachment; filename="' || SUBSTR(v_file_name, INSTR(v_file_name, '/') + 1) || '"');
        owa_util.http_header_close;
        wpg_docload.download_file(Lob_loc);
      End download_my_file;I could put a sample application on apex.oracle.com, but it wouldn't be able to access the file system on that server.

  • SQL*Loader and unzipping with uploaded file

    hi, everybody
    i was trying to integrate some functionalities, today separated. i made a simple Apex page that uploads a file, and now i need to process that file.
    is there any way to process that uploaded file and load it onto a table, just like i'd do with Sql*Loader?
    in the same way, can i unzip an uploaded zip file, just like Oracle Portal 3.0.9 used to do in its contect areas with zip itens?
    thanks

    Hi, Ivo
    about ult_compress, ok. i'll check it out.
    talking about uploaded files, the only thing i've found were:
    a) download an uploaded file
    b) use an uploaded image to integrate in a web application.
    unfortunately, i didn't find anything that could help me process an uploaded text file the way i do with SQL*Loader.
    i'll keep on trying
    thanx

Maybe you are looking for

  • Need some help getting started with Mobility Services Engine

    Someone has ordered several 3602 access points, a 5508 controller, and a MSE 3310 for one of our remote locations. The access points and controller are in place and are working fine (we use lightweight APs at many other locations), but I'm not sure h

  • How to assign values to Dynamic VO.

    Hi All, I have created a Dynamic VO and i have created 2 attributes(name and age) for it. Can i create this dynamic VO in Process form request of one of the CO class? Please let me know how to assign values to it......and display it and the page.? Th

  • Join Button Grayed Out

    My iPad connects with no problem at home on my Time Capsule and Airport Extreme Routers. At my office, I can't even find out if it will connect or not, because when I select the network to join it, as soon as I type in a password, the JOIN button gra

  • Updating version on WTR54G

    Can anyone point me to the instructions for updating the version on a WTR54G wireless router?  My current version is 1.00.1 and I see the current version is V4[1].0_4.21.1...

  • Hidden Hard Drive Files With Zen Micro 5

    Just started loading my Zen Micro with music files this week. I ensured that I only copied files to the player itself, but it seems like my hard dri've's available space is getting smaller and smaller. I used the Zen Micro Media Explorer to rip direc