KM Content:- unable to upload and Download KM Content

Hi,
we have three systems dev,quality,and production.
i have some files in KM Quality which have to be transported to production.
i can able the download file "fullupdate.zip" from quality.
but when i am uploading into production nothing is happening,
i used the path  content management->content Exchange->package Upload.
when i select the file and click on upload it is processing for some time and showing the same screen again,
not getting any error message or confirmation message.
one more thing i am also not able to upload a file from local desktop to KM.
i can able to create folders and links .
Note:-in the subscriber and syndicator the properties  url points tp production server
         EP installed on unix system.
Regards
K Naveen Kishore.
Edited by: Naveen Kishore on Feb 22, 2011 8:16 AM

Hello Lorcan,
the issue is solved  without applying the note.
once i have restarted the server it is working fine now.
thankyou.
Regards
K Naveen Kishore.

Similar Messages

  • Program to upload and download table content

    Hi,
    I need to create a program which should upload and download table content from PC and to PC.
    How can i develop this program..Should i use BDC or any function module?
    Ezhil.

    The 2 program requested.....
    Program to Download
    REPORT ztable_download.
    PARAMETERS: table LIKE dd02d-tabname,
                                file(50) LOWER CASE.
    DATA: code(72) OCCURS 10,
                w_code(72),
                prog(8),
                msg(120),
                lin(3),
                wrd(10),
                off(3).
    DATA: BEGIN OF rectest,
          tprec(1) VALUE '0',
          nometab(16),
          utente(20),
          data(10),
          ora(8),
    END OF rectest.
    DATA: BEGIN OF recdett,
          tprec(1) VALUE '1',
          tab LIKE table,
    END OF recdett.
    DATA: BEGIN OF rectot,
        tprec(1) VALUE '2',
        tot(9),
    END OF rectot.
    OPEN DATASET file FOR OUTPUT IN TEXT MODE.
    rectest-nometab = table.
    rectest-utente = sy-uname.
    rectest-data = sy-datum.
    rectest-ora = sy-uzeit.
    TRANSFER rectest TO file.
    APPEND 'PROGRAM SUBPOOL.'  TO code.
    CONCATENATE 'TABLES ' table '.' INTO w_code SEPARATED BY space.
    APPEND w_code TO code.
    APPEND 'FORM DYN1 USING FILE.' TO code.
    CONCATENATE 'SELECT * FROM ' table '.'
    INTO w_code SEPARATED BY space.
    APPEND w_code TO code.
    CONCATENATE 'TRANSFER ' table ' TO FILE.'
    INTO w_code SEPARATED BY space.
    APPEND w_code TO code.
    APPEND 'ENDSELECT.' TO code.
    APPEND 'ENDFORM.' TO code.
    GENERATE SUBROUTINE POOL code NAME prog
    MESSAGE msg LINE lin WORD wrd OFFSET off.
    IF sy-subrc <> 0.
       WRITE: / 'Error during generation in line', lin,
                    / msg,
                    / 'Word:', wrd, 'at offset', off.
    ELSE.
       PERFORM dyn1 IN PROGRAM (prog) USING file.
       WRITE: / 'Esportati ',sy-dbcnt,' records.'.
    ENDIF.
    Program to upload
    REPORT Ztable_upload.
    PARAMETERS: FILE(50) lower case,
                               TEST AS CHECKBOX.
    DATA: CODE(72) OCCURS 10,
                W_CODE(72),
                PROG(8),
                MSG(120),
                LIN(3),
                WRD(10),
                OFF(3).
    DATA: BEGIN OF RECTEST,
          TPREC(1) VALUE '0',
          NOMETAB(16),
          UTENTE(20),
          DATA TYPE D,
          ORA TYPE T,
    END OF RECTEST.
    DATA: BEGIN OF RECTOT,
          TPREC(1) VALUE '2',
          TOT(9),
    END OF RECTOT.
    OPEN DATASET FILE FOR INPUT IN TEXT MODE.
    READ DATASET FILE INTO RECTEST.
    WRITE:/ 'Tabella..:',RECTEST-NOMETAB.
    WRITE:/ 'Utente...:',RECTEST-UTENTE.
    WRITE:/ 'Data.....:',RECTEST-DATA,RECTEST-ORA.
    IF TEST = 'X'.
        APPEND 'PROGRAM SUBPOOL.'  TO CODE.
       CONCATENATE 'TABLES ' RECTEST-NOMETAB '.'
       INTO W_CODE SEPARATED BY SPACE.
      APPEND W_CODE TO CODE.
      APPEND 'FORM DYN1 USING FILE.' TO CODE.
      APPEND 'DATA W_COUNT TYPE P.' TO CODE.
      CONCATENATE 'SELECT * FROM' RECTEST-NOMETAB '.'
      INTO W_CODE SEPARATED BY SPACE.
      APPEND W_CODE TO CODE.
      CONCATENATE 'DELETE' RECTEST-NOMETAB '.'
      INTO W_CODE SEPARATED BY SPACE.
      APPEND W_CODE TO CODE.
      APPEND 'ENDSELECT.' TO CODE.
      APPEND ' DO.' TO CODE.
      CONCATENATE 'READ DATASET FILE INTO' RECTEST-NOMETAB '.'
      INTO W_CODE SEPARATED BY SPACE.
      APPEND W_CODE TO CODE.
      APPEND ' IF SY-SUBRC NE 0.' TO CODE.
      APPEND ' EXIT.' TO CODE.
      APPEND ' ENDIF.' TO CODE.
      CONCATENATE ' INSERT ' RECTEST-NOMETAB '.'
      INTO W_CODE SEPARATED BY SPACE.
      APPEND W_CODE TO CODE.
      APPEND 'ADD 1 TO W_COUNT.' TO CODE.
      APPEND 'ENDDO.' TO CODE.
      APPEND ' write: / ''Importati'' ,W_COUNT, ''records''.' TO CODE.
      APPEND 'ENDFORM.' TO CODE.
      GENERATE SUBROUTINE POOL CODE NAME PROG
      MESSAGE MSG LINE LIN WORD WRD OFFSET OFF.
      IF SY-SUBRC <> 0.
         WRITE: / 'Error during generation in line', LIN,
         / MSG,
         / 'Word:', WRD, 'at offset', OFF.
      ELSE.
         PERFORM DYN1 IN PROGRAM (PROG) USING FILE.
      ENDIF.
    ENDIF.
    Edited by: robcom69 on Feb 23, 2010 2:35 PM

  • Uploading and downloading blobs without wwv_flow_files

    Hi,
    I am currently working on oracle 10g database and application express.
    i went throu the material to upload and download images, pdf from a htmldb book.
    it was excellent material. but the book only gave example about loading and downloading images, pdf through flows_files.wwv_flow_files view.
    it seemed like we can only d/l the pdf, images and display on htmldb report only throu flows_files.wwv_flow_files view, as in the case of the script below
    select
       wff.id, htf.anchor( 'p?n=' || wff.id, wff.filename ) filename_1,
       wff.filename filename_2, ed.abstract abstract
    from
       wwv_flow_files wff, easy_document ed
    where
       wff.name = ed.name;but is there a way to load and download images, pdfs from my own tables without the involvement of flows_files schema.
    if then how can i modify the above code to get the pdf from the following table
    TableA (vessel number, cruise number, pdf blob)
    here for every (vessel, cruise) combination there is a pdf.
    how can i get this pdf displayed in my htmldb report.
    Can someone guide me please.
    Thanks,
    Philip.

    Hi,
    I tried the document link you gave and it looks like, i can directly download pdfs from my own tables without needding to upload to wwv_flow_files_objecst$ table.
    i modified the procedure in the document accroding to my requirements and it worked.
    in my page i show a grid with the parameters and the pdf documentname as download link.
    when i click on the link a popup window with the option to save or open comes up.
    but the popup window shows the filename as my procedure name through which i pass the id for the pdf document instaed of the filename which is shown as download link on the page.
    How can i change this popup window filename to the default file name shown in the download link.
    so that everytime i select the parameters, the page shows the pdf filename as link and on clicking the link the popup window should be able to show the same name shown as link.
    i think this can be set either at the procedure level or at the page level.
    and this is the following contents of the procedure
    --        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('PDF','application/octet'), FALSE );
                    -- set the size so the browser knows how much to download
                     htp.p('Content-length: ' || B_LEN);
                    -- the filename will be used by the browser if the users does a save as
    -- htp.p('Content-Disposition:  attachment; filename="'||'CR'||VES||CRU||'.PDF'|| '"');
                    -- close the headers           
                    owa_util.http_header_close;
                    -- download the BLOB
                    wpg_docload.download_file( BREP );and this is what i did at the page level. for that particular column i went to link option and the foll is what i gave:
    Link Text: CR#VESSEL##CRUISE#.PDF
    Link Attributes: target="_blank"
    URL: #OWNER#.PROC_DOWNLOAD_PDFS?V=#VESSEL#&C=#CRUISE#
    Here the link text is the filename that i wanted to show when saving the file.
    Can someone guid eme please.
    Thanks,
    Philip.

  • Upload and download a PDF in BSP

    Hi All,
    I need to do the following funtionalityin BSP (business server page ).
    1)upload and download a PDF
    Pls anyone help me by providing the necessary code to do this .
    Thanks in Advance
    Rizwan

    Hi,
    This link is useful for U
    http://help.sap.com/saphelp_nw04/helpdata/en/eb/8c683c8de8a969e10000000a114084/content.htm
    http://wiki.sdn.sap.com/wiki/display/BSP/HandlingBinaryData
    Regards
    kk

  • Reg :File upload and download from client machine

    hi..
    anyone help me the way that how to upload and download word
    document file from client machine.. i am using j2eeserver1.4 in linux..
    i want upload file from client machine(windows) to server(linux.) please
    help me . tell me idea regarding..
    i have tried this coding.. but i can transfer txt file. only. when i upload mirosoft word file.. it will open with some ascii values with actual content.
    <!-- upload.jsp -->
    <%@ page import="java.io.*" %>
    <%String contentType = request.getContentType();
    String file = "";
    String saveFile = "";
    FileOutputStream fileOut = null;
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength)
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    try { 
    file = new String(dataBytes);
    saveFile = file.substring(file.indexOf("filename=\"") + 10);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    saveFile = saveFile.substring(saveFile.lastIndexOf("/") + 1,saveFile.indexOf("\""));
    int lastIndex = contentType.lastIndexOf("=");
    String boundary = contentType.substring(lastIndex + 1,contentType.length());
    int pos;
    pos = file.indexOf("filename=/" + 1);
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    String folder = "/tmp/uploads/";
    fileOut = new FileOutputStream(folder + saveFile);
    fileOut.write(dataBytes);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush(); } catch(Exception e) {  out.print(e);
    } finally
    {  try
    {fileOut.close();
    }catch(Exception err)
    %>
    please which package will help me to upload word document file with no errror. send me how can use in ftp.. send me some sample program..
    Regards..
    New User M.Senthil..

    Hi,
    Well,i don't know whether if this helps people here are not.
    It is always a good practise to do it via Servlet and then download content.
    The adavantage of doing this is
    1). You may not need to pack the downloadable with the .war which you ultimately genrate which ceratinly help us in terms of faster deployment.
    3). You may update the new content just by moving a file to the backup folder.
    2).One may definately download the content irrespective to the content/file.
    Hope example below helps..
    Configurations:
    In the above example we are assuming that we placing all downlodable file in D:/webapp/downlodables/ and you have configured the same path as a init param with the name "filePath" in your web.xml.
    something like the one below.
    <servlet>
        <servlet-name>DownloadServlet</servlet-name>
        <servlet-class>com.DownloadServlet</servlet-class>
        <init-param>
           <param-name>filePath</param-name>
           <param-value>D:/webapp/downlodables/</param-name>
           <!--Could use any backup folder Available on your Server-->
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>DownloadServlet</servlet-name>
        <url-pattern>/downloadFile</url-pattern>
    </servlet-mapping>DownloadServlet.java:
    ==================
    package com;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import javax.activation.MimetypesFileTypeMap;
    *@Author RaHuL
    /**Download Servlet
    *  which could be accessed downloadFile?fid=fileName
    *  or
    *  http://HOST_NAME:APPLN_PORT/ApplnContext/downloadFile?fid=fileName
    public class DownloadServlet extends HttpServlet{
      private static String filePath = new String();
      private static boolean dirExists = false;
      public void init(ServletConfig config){
          // Acquiring Backup Folder Part
          filePath = config.getInitParameter("filePath");
          dirExists = new File(filePath).exists();      
      private void processAction(HttpServletRequest request,HttpServletResponse response) throws Exception{
           // Some Authentication Checks depending upon requirements.
           // getting fileName which user is requesting for
           String fileName = request.getParameter("fid");
           //Building the filePath
           StringBuffer  tFile = new StringBuffer();
           tFile.append(filePath);    
           tFile.append("fileName"); 
           boolean exists = new File(tFile.toString()).exists();
           // Checking whether the file Exists or not      
           if(exists){
            FileInputStream input = null;
            BufferedOutputStream output = null; 
            int contentLength = 0;
            try{
                // Getting the Mime-Type
                String contentType = new MimetypesFileTypeMap().getContentType(tFile.toString());          
                input = new FileInputStream(tFile.toString());
                contentLength = input.available();
                response.setContentType(contentType);
                response.setContentLength(contentLength);
                response.setHeader("Content-Disposition","attachment;filename="+fileName);
                output = new BufferedOutputStream(response.getOutputStream());
                while ( contentLength-- > 0 ) {
                   output.write(input.read());
                 output.flush();
              }catch(IOException e) {
                     System.err.println("Exception Occured:"+e.getMessage());
                 System.err.println("Exception Localized Message:"+e.getLocalizedMessage());
              } finally {
                   if (output != null) {
                       try {
                          output.close();
                      } catch (IOException ie) {
                          System.err.println("Exception Occured:"+e.getMessage());
                             System.err.println("Exception Localized Message:"+e.getLocalizedMessage());                      
           }else{
             response.sendRedirect("/errorPage.html");
      public void doPost(HttpServletRequest request,HttpServletResponse response) throws Exception{       
            processAction(request,response); 
      public void doGet(HttpServletRequest request,HttpServletResponse response) throws Exception{
            processAction(request,response); 
    NOTE: Make sure You include activations.jar in your CLASSPATH b4 trying the code.
    therefore,if you have something like above set as your application enviroment in the above disccussed
    can be done by just giving a simple hyper link like
    <a href="downloadFile?fid=fileName.qxd" target="_blank">Download File</a>REGARDS,
    RaHuL

  • File Upload and Download in Oracle iAS PL/SQL Gateway

    i'm using the example 113471.1 to "File Upload and Download in
    Oracle iAS PL/SQL Gateway"
    when i press the submit button after i select a file to upload
    i get the next message in the browser "No se puede mostrar la
    pagina" HTTP 404 file not found.
    I think the problem is in ctnsample.upload_form in the line
    htp.formOpen(curl => 'cntsample.upload', cmethod => 'POST',
    cenctype => 'multipart/form-data');
    The ctnsample.remove work fine.
    Could you,help me...

    There is a document in the Oracle 9iAS 1.0.2.2 Library titled "Using the PL-SQL Gateway" Part Number A90099-01.pdf that explains file upload and download through modplsql. In particular there is a section there titled "Direct BLOB Download" which explains how one can easily download a blob utilising the wpg_docload package.
    I am still concerned that there exist duplicate copies of my blob content. One copy in the wwdoc_document$ table, and one in my custom table.
    Dmitry/Oracle can you confirm this?

  • Upload and Download of files

    I am working on a web site development work. I am working with STRUTS framework tht is made over the jsp tag library..Can any one help me about how to upload and download files from server and to the server.If possible using struts framework. Pls do give a pratical example..
    regards jay

    Like this:
            //upload
            String fileName = formFile.getFileName();
         Sting  destFile = "c:/upload/" + fileName;//path to save the upload file on server
         try {
                 InputStream     in = formFile.getInputStream();
              OutputStream     out = new FileOutputStream( new File(destFile) );
              int n = 0;
              byte[] buff = new byte[8192];
              while( (n = in.read( buff, 0, 8192 )) != -1 ) {
                   out.write( buff, 0, n );
              out.close();
              in.close();     
            }catch(Exception e){
            //download
            String serverFile = "c:/upload/a.txt";//file path on server to be downloaded
            File serverF = new File(serverFile);
            response.setContentType("text/html");
         response.setHeader("Content-Disposition","attachment;filename="+serverF.getFileName()+";");
         try {
             ServletOutputStream outStream = response.getOutputStream();
             FileInputStream stream = new FileInputStream(serverF);
             BufferedInputStream  bis = new BufferedInputStream(stream);
             BufferedOutputStream bos = new BufferedOutputStream(outStream);
             byte[] buff = new byte[2048];
             int bytesRead;
                try{
                 while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
                      bos.write(buff, 0, bytesRead);
             } catch (Exception e) {
                } finally {
            if (bis != null) bis.close();
            if (bos != null) bos.close();
            if (stream != null) stream.close();
         }catch (IOException e){
         }

  • Upload and download files

    Hi,
         I have to upload and Download the scanned images using my Webdynpro  Abap application.Please send anybody having sample app document for this.
    Regards,
    KumarL K

    Hi,
    Refer these online help: [FileUpload|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/content.htm], [FileDownload|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm].
    I hope it helps.
    Regards
    Arjun

  • Uploading and downloading files in webdynpro java

    how to upload and download xl files in webdynpro java application .

    Hi ,
    Refer these links they maybe helpful to you
    You can check this sampple example from SDN
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40db4a53-41a9-2910-d4a2-9c28283f6658
    Uploading and Downloading Files In Web Dynpro Java
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/202a850a-58e0-2910-eeb3-bfc3e081257f
    http://help.sap.com/saphelp_nw04/helpdata/en/43/85b27dc9af2679e10000000a1553f7/content.htm
    Uploading and Downloading Files In Web Dynpro Tables
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0e10426-77ca-2910-7eb5-d7d8982cb83f
    Some more links regarding Uploading and DownLoading Files
    Uploading and downloading files
    Upload and Download file through RFC called by java
    Regards,
    Saleem

  • How can I upload and download files with uiXML?

    I want to implement upload and download files with uiXML. In some previouse topic I got answare to look in AbstractPageBroker class in JavaDOC. I did it but this is a very-very little resolution description for this problem. I think for developers YOU (UIX Team) must in very quick time to put some examples on the NET because this is a nice technology but with adecvate samplase and developers guide it will be dead very soon. I digging this forum for information. I see many many people have same problems about this technology. They like it and want to use and try but documentation is very very poor.
    WE WANT EXAMPLES and separate forum for UIX. I think it deserve this.
    If You have any more detailed documentation would be nice to put on the net. I have uixdemo.zip file but this is in very early fase of development. I downloaded it before fwe months. And now I can't find it anymore on youre site. What happend?

    Attila -
    I went back and re-read the JavaDoc for AbstractPageBroker and MultipartFormItem and put together the following sample PageBroker based on the description from the JavaDoc:
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.share.util.MultipartFormItem;
    import oracle.cabo.servlet.xml.UIXPageBroker;
    * An extension of UIXPageBroker which stores all uploaded
    * files in the temporary directory.
    public class UploadingPageBroker extends UIXPageBroker
    * Override of AbstractPageBroker.doUploadFile() which saves
    * all files to the temporary directory.
    protected String doUploadFile(
    BajaContext context,
    Page page,
    MultipartFormItem item) throws IOException
    // Get the location of the file to create in the temp directory.
    // Of course a real application probably wouldn't upload files to
    // the temp directory - just using this contrived example to
    // demonstrate basic uploading support.
    File file = _getFile(context, item);
    if (file != null)
    // Create a FileOutputStream. Of course, a real application would
    // probably want to buffer the output
    FileOutputStream out = new FileOutputStream(file);
    // Write out the file
    item.writeFile(out);
    // Close up the output stream
    out.close();
    // We can return a value here to add to the PageEvent
    // if so desired.
    return null;
    // Gets the File for the item that we are uploading
    private File _getFile(
    BajaContext context,
    MultipartFormItem item
    // Get the file name
    String name = item.getFilename();
    // If we don't have a file, bail...
    if (name == null)
    return null;
    // Get the path to the temporary directory
    File dir = _getTempDir();
    // Return the File object
    return new File(dir, name);
    // Returns the path to the temprary directory
    private File _getTempDir()
    // Get the temporary directory from the ServletContext
    ServletConfig sConfig = getServlet().getServletConfig();
    ServletContext sContext = sConfig.getServletContext();
    return (File)sContext.getAttribute("javax.servlet.context.tempdir");
    In this sample, each uploaded file is simply saved in the temporary directory. You'll want to replace the code that creates the FileOutputStream for the uploaded file to use whatever OutputStream makes sense for your application.
    BTW - I used the following UIX page to test this out:
    <?xml version="1.0" encoding="UTF-8"?>
    <page xmlns="http://xmlns.oracle.com/uix/controller">
    <content>
    <pageLayout xmlns="http://xmlns.oracle.com/uix/ui">
    <contents>
    <form name="uploadForm" usesUpload="true">
    <contents>
    <fileUpload name="uploadedFile"/>
    <submitButton name="upload" text="Upload"/>
    </contents>
    </form>
    </contents>
    </pageLayout>
    </content>
    </page>
    Hope this sample helps with the uploading part of your question. I'll see if I can provide a download sample in a later post.

  • How to Upload and Download Files

    Dear Friends
    I want to write code for Upload and Download file ( Group of Files). Please Guide me the right way I have a few java files and i have compiled that but i donot know how to run that file and i am stranger to java also.
    Please send me reply and sugessest me.
    my email id is [email protected]
    Amogh

    I have write a upload code, but the code can deal with txt onle, it can not deal with bmp or doc, what the matter?
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Upload extends HttpServlet {
         String rootPath;
         static final int MAX_SIZE = 102400;
         public void init(ServletConfig config) throws ServletException
              super.init(config);
         public void doGet(HttpServletRequest request,HttpServletResponse response)
         throws ServletException,IOException
              response.setContentType("text/html");
              PrintWriter out = new PrintWriter (response.getOutputStream());
              out.println("<html>");
              out.println("<head><title>Servlet1</title></head>");
              out.println("<body><form ENCTYPE=\'multipart/form-data\' method=post action=''><input type=file enctype=\'multipart/form-data\' name=filedata>");
              out.println("<input type=submit></form>");
              out.println("</body></html>");
              out.close();
         public void doPost(HttpServletRequest request,HttpServletResponse response)
              ServletOutputStream out=null;
              DataInputStream in=null;
              FileOutputStream fileOut=null;
              rootPath = "C:\\upload\\tmp\\";          //The directory to save the target file.
              try
                   response.setContentType("text/plain");
                   out = response.getOutputStream();
              catch (IOException e)
                   System.out.println("Error getting output stream.");
                   System.out.println("Error description: " + e);
                   return;
         try
              String contentType = request.getContentType();
              if(contentType != null && contentType.indexOf("multipart/form-data") != -1)
                   in = new DataInputStream(request.getInputStream());
                   int formDataLength = request.getContentLength();
                   byte dataBytes[] = new byte[formDataLength];
                   int bytesRead = 0;
                   int totalBytesRead = 0;
                   int sizeCheck = 0;
                   String sourceFileName = "";
                   String targetFileName = "";
                   while (totalBytesRead < formDataLength)
                        sizeCheck = totalBytesRead + in.available();
                        if (sizeCheck > MAX_SIZE)
                             out.println("Sorry, file is too large to upload.");
                             return;
                        bytesRead = in.read(dataBytes, totalBytesRead, formDataLength);
                        totalBytesRead += bytesRead;
                   String file = new String(dataBytes);
                   dataBytes = null;
                   int lastIndex = contentType.lastIndexOf("=");
                   String boundary = contentType.substring(lastIndex+1, contentType.length());
                   //File Content
                   //out.println("File content: " + file);
                   if (file.indexOf("name=") > 0)
                        int fileNameStart = 0;
                        int fileNameEnd = 0;
                        fileNameStart = file.indexOf("filename=\"");
                        fileNameEnd = file.indexOf("Content-Type:");
                        sourceFileName = file.substring(fileNameStart + 10, fileNameEnd - 3);
                        //Source File
                        out.println("Source file: " + sourceFileName);
                   String successPage="";
                   if (file.indexOf("name=\"SuccessPage\"") > 0)
                        successPage = file.substring(file.indexOf("name=\"SuccessPage\""));
                        successPage = successPage.substring(successPage.indexOf("\n")+1);
                        successPage = successPage.substring(successPage.indexOf("\n")+1);
                        successPage = successPage.substring(0,successPage.indexOf("\n")-1);}
                        String overWrite;
                        if (file.indexOf("name=\"OverWrite\"") > 0)
                             overWrite = file.substring(file.indexOf("name=\"OverWrite\""));
                             overWrite = overWrite.substring(
                             overWrite.indexOf("\n")+1);
                             overWrite = overWrite.substring(overWrite.indexOf("\n")+1);
                             overWrite = overWrite.substring(0,overWrite.indexOf("\n")-1);
                        else
                             overWrite = "false";
                        String overWritePage="";
                        if (file.indexOf("name=\"OverWritePage\"") > 0)
                             overWritePage = file.substring(file.indexOf("name=\"OverWritePage\""));
                             overWritePage = overWritePage.substring(overWritePage.indexOf("\n")+1);
                             overWritePage = overWritePage.substring(overWritePage.indexOf("\n")+1);
                             overWritePage = overWritePage.substring(0,overWritePage.indexOf("\n")-1);
                        targetFileName = sourceFileName.substring(sourceFileName.lastIndexOf("\\") + 1);
                        targetFileName = rootPath + targetFileName;
                        //Target File:
                        out.println("Target file: " + targetFileName);
                        int pos; //position in upload file
                        pos = file.indexOf("filename=");
                        pos = file.indexOf("\n",pos)+1;
                        pos = file.indexOf("\n",pos)+1;
                        pos = file.indexOf("\n",pos)+1;
                        int boundaryLocation = file.indexOf(boundary,pos)-4;
                        file = file.substring(pos,boundaryLocation);
                        File checkFile = new File(targetFileName);
                        if (checkFile.exists())
                             if (!overWrite.toLowerCase().equals("true"))
                                  if (overWritePage.equals(""))
                                       out.println("Sorry, file already exists.");
                                  else
                                       //redirect client to OverWrite HTML page
                                       response.sendRedirect(overWritePage);
                                  return;
                        File fileDir = new File(rootPath);
                        if (!fileDir.exists())
                             fileDir.mkdirs();
                        fileOut = new FileOutputStream(targetFileName);
                        fileOut.write(file.getBytes(),0,file.length());
                        if (successPage.equals(""))
                             out.println("File written to: " + targetFileName);
                        else
                             response.sendRedirect(successPage);
                        else //request is not multipart/form-data
                             out.println("Request not multipart/form-data.");
                   catch(Exception e)
                        try
                             System.out.println("Error in doPost: " + e);
                             out.println("An unexpected error has occurred.");
                             out.println("Error description: " + e);
                        catch (Exception f) {}
                   finally
                   try
                        fileOut.close(); //close file output stream
                   catch (Exception f) {}
                   try
                        in.close(); //close input stream from client
                   catch (Exception f) {}
                   try
                        out.close(); //close output stream to client
                   catch (Exception f) {}
    }

  • How to upload and download image?

    hi,
    can anyone send me links  how to to upload and download image to and from sever
    Here i am using amfphp,mysql,php
    i have an button and textfield.when i clicked on the button the path will be stored into database and image will be
    stored into server folder.Similarly for edit i want to display that image to end user.How to do that?

    hi,
    you need to first bring the image into your sap system.
    that you can achieve by right clicking you application and then clicking on create mime object.
    check out this link too:
    Re: how to upload an image file(or any file) in mime using file upload ui eleme
    then you have to insert an image ui element in your view.
    check out the link:
    http://help.sap.com/saphelp_nw04/helpdata/en/f3/1a61a9dc7f2e4199458e964e76b4ba/content.htm
    according to you req i think you need to upload and download the image file in your system using a button. so for this you can follow the below link:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71
    hope this will surely help you!!!
    thanks & regards,
    punit raval.
    Edited by: punit raval on Jun 24, 2009 9:56 AM

  • Uploading and downloading files from a web app (Urgent!!)

    Hi everyone:
    I'm developing an application in PL/SQL to upload and download files from an HTML webpage. I congured the document table and the parameters necessary in the DAD of my application.
    when I upload the file using my webpage that file info is automatically uploaded to the doc table. This is as far as I have gotten.
    I need to do the following:
    - Place the uploaded file into a column in another table in my database as part of a text message (think of it as an email message), and delete the file from the doc table (as this is thought to be a temp table that holds the file when uploaded from my webpage)
    - Retreive the file so that it can be downloaded from another web page.
    The file can be a PDF, WORD DOC, etc...
    I now that I can do this with InterMedia but I haven't figured out how :(
    Can anyone please point me to an example or some documentation that can guide me through the process.
    DB VERSION: 8.1.7
    IAS VERSION: 1.0.2.2
    Thanks,
    Carlos Abarca

    The idea was for you to look at the code and get an idea of how to access the BLOB in the document table. IF you look at the procedure
    insert_new_photo( new_description IN VARCHAR2,
    new_location IN VARCHAR,
    new_photo IN VARCHAR2 )
    It shows how to access the blob that is stored in the document table. You can then copy this blob to your own table using the DBMS_LOB package.
    Hope this helps,
    Larry

  • How to upload and Download the file in a system through java programing

    I am trying to upload a file as well as want to download the uploaded file in my system....I don't have any server an all.
    I want to implement this in my system only .
    I got this code but i don't know ,where i have to make the change and what are the parameters i have to pass.
    can any one help me on this code ....please
    here some piece of code
    File Upload and Download Code Example
    package com.resource.util;
    public class FileUpload
    public void upload( String ftpServer, String user, String password,
    String fileName, File source ) throws MalformedURLException,
    IOException
    if (ftpServer != null && fileName != null && source != null)
    StringBuffer sb = new StringBuffer( "ftp://" );
    // check for authentication else assume its anonymous access.
    if (user != null && password != null)
    sb.append( user );
    sb.append( ':' );
    sb.append( password );
    sb.append( '@' );
    sb.append( ftpServer );
    sb.append( '/' );
    sb.append( fileName );
    * type ==> a=ASCII mode, i=image (binary) mode, d= file directory
    * listing
    sb.append( ";type=i" );
    BufferedInputStream bis = null;
    BufferedOutputStream bos = null;
    try
    URL url = new URL( sb.toString() );
    URLConnection urlc = url.openConnection();
    bos = new BufferedOutputStream( urlc.getOutputStream() );
    bis = new BufferedInputStream( new FileInputStream( source ) );
    int i;
    // read byte by byte until end of stream
    while ((i = bis.read()) != -1)
    bos.write( i );
    finally
    if (bis != null)
    try
    bis.close();
    catch (IOException ioe)
    ioe.printStackTrace();
    if (bos != null)
    try
    bos.close();
    catch (IOException ioe)
    ioe.printStackTrace();
    else
    System.out.println( "Input not available." );
    }

    At least that is what the code you posted suggests to me.It looks like that to me too.
    I believe that
    URLConnection urlc = url.openConnection(url);Will return you an FTP URLConnection implementation if you pass it a ftp:// url
    So for simple FTP ops, you don't need any external libs.
    Actually, looking at your code, this is already what you are doing, so I really don't get this:
    am not using FTP server..... i want to implement in my system only ....So How i will do.
    Can you give me any idea based on this code Can you explain a bit more what you need?
    patumaire

  • File upload and download through web Dynpro2.0.9.

    Hai All,
          File upload and download through web Dynpro "IWDResource" package is used.But in web Dynpro 2.0.9. this package is not possible.How to uplolad and download  files through web Dynpro2.0.9.
          Anyone can help me?
    Thanks in Advance,
    Kindly Regards,
    K.Saravanan.

    Hi Saravanan,
    You can go through these links,
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/63/9c0e41a346ef6fe10000000a1550b0/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/63/9c0e41a346ef6fe10000000a1550b0/frameset.htm</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/frameset.htm</a>
    So, apart from putting FileUpload UI on your view, you have to implement a method which will do the actual uplod for you.
    Hope this helps.
    Regards,
    Mausam

Maybe you are looking for