Upload File using MDS WCF API

I have a field of File Type in my Entity. How can I upload file using WCF API?
I tried to create a new Entity Member and added the following attribute in the member attributes collection
Attribute att = new Attribute();
att.Identifier = new Identifier();
att.Identifier.Name = "Image";
att.Value = bytes;
In attribute value I tried to pass the bytes array of an image, also tried Encoding.ASCII.GetString(bytes); as attribute value, but none of them works.
With byte array i get the following exception "Conversion failed when converting the nvarchar value 'System.Byte[]' to data type int." and in case of ASCII string i get "A database error has occurred. Contact your system administrator." error.
There is lack of documentation and samples.
Please let me know if someone tried it out.
Thanks!

You need to use the EntityMemberAttributesGet operation to retrieve the contents of a file attribute. EntityMembersGet is designed to retrieve a collection of many members and therefore it would not make sense to retrieve every file for every row retrieved.
In contrast, EntityMemberAttributesGet is designed to work with a single member and specific attributes of that member, and it was designed to retrieve the file content.
Val Lovicz
http://www.profisee.com
[email protected]
As the original creators of Microsoft MDS, Profisee's Master Data Maestro provides a range of enterprise-grade functionality to ensure MDS project success.

Similar Messages

  • Problems while uploading files using the FileReference API

    I've built an image uploader module in Flex using the FileReference API and PHP.
    While this works perfect for images upto 1 MB, What I'm noticing is that for images greater that 1 MB even after the Event.COMPLETE  has triggered, the file hasn't yet been uploaded into the folder.. its only after a couple of seconds or minutes after the Event.COMPLETE,  that the image actually shows up in the FTP folder. Morever I also noticed that for such files the DataEvent.UPLOAD_COMPLETE_DATA that we are using to get feedback from PHP never gets called.
    I thought it would be related to the PHP script getting timed out... but the PHP script does get executed and the images do show up in the folder but thats way after the Event.Complete has been triggered and more importantly  DataEvent.UPLOAD_COMPLETE_DATA doesnt get called.
    Everything seems to work fine as long as the file size is under 1 MB
    Did others too face similar problems and any ideas on how to fix it?
    Thanks in advance

    I don't believe there is, as the browse button renders out as an html input type file component, and this has no ability to get native file size from the client. The only way to do it is to check the file size server side, but that kind of defeats the purpose to some extent, as the file is required to be uploaded before the file size can be checked.
    There is no way to do this on the client short of using a third party client side component - ie. java, flash or some other active component that gets file system level access.
    Ben

  • Maximum size of upload file using Cross Domain Library

    Hi All 
    I need to know what is the maximum size of file that I can upload using Cross Domain Library from my Provider hosted app. I know that in msdn it is written that usign REST call we can upload upto 2GB but I have doubts if it is true with Cross domain library
    REST Calls. Please suggest.
     spExecutor.executeAsync(
                                   url: fileCollectionEndpoint,
                                   method: "POST",
                                   contentType: "application/json;odata=verbose",
                                   body: filedata,
                                   binaryStringRequestBody: true,
                                   headers: { "X-RequestDigest": $("#__REQUESTDIGEST").val(), "accept": "application/json;odata=verbose" ........
    And Can I pass ArrayBuffer directly or I need to pass only binary string ?
    Thanks in Advance 

    Hi,
    According to your post, my understanding is that you want to know the Maximum size of upload file using Cross Domain Library.
    Per my knowledge, you can upload files up to 2 GB with the REST API. 
    You can refer to:
    How to: Upload a file by using the REST API and jQuery
    In addition, you can pass ArrayBuffer directly. Please refer to:
    FileCollection methods
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • How to upload file using  *cl_gui_frontend_services* method

    hi
    i want to upload an image file using this method
    and i want to save it in MIME Repository (/SAP/BC/BSP/SAP/PRASHANT)
    DATA:
    itab TYPE TABLE OF sflight.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = 'C:\temp\winter.jpg'
        filetype                = 'ASC'
        has_field_separator     = '|'
      CHANGING
        data_tab                = itab
    IF sy-subrc = 0.
    WRITE:/ 'success'.
    ENDIF.
    So plz tel me how i set given path to upload file using this method .

    Hi Prashant,
    Go through the [Link|https://forums.sdn.sap.com/click.jspa?searchID=24477690&messageID=6684222].
    Hope this is helpful.
    Regards,
    Abhinav

  • Upload files using browser

    how is posible upload files using a browser (IE5) to BD ?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JuanCarlos HorrachCampins (jchorrach@globalia:
    how is posible upload files using a browser (IE5) to BD ?<HR></BLOCKQUOTE>
    The Form enctype=multipart/formdata and input type=file parameters are needed along with method=post.
    You then need a servlet(or MS PostingAcceptor) on the server side to read/store it. The Post data is in multiple parts with the parms on separate lines..
    Here is sample HTML Form:
    <HTML>
    <BODY>
    <H2>Uplaod test </H2>
    <form enctype="multipart/form-data" action="/examples/servlet/MultipartForm"
    METHOD="POST"
    NAME="UploadFileForm"
    LANGUAGE="JavaScript"
    onSubmit="if (!validateForm(document.UploadFileForm))
    alert ('Please enter a fileName.');
    document.UploadFileForm.my_file.select();
    return false;
    }">
    <input type="text" name="TargetURL" value="/uploads">
    <input type="text" name="submitter" value="me">
    <FIELDSET> <legend> FileUpload</legend>
    <BR>
    <table>
    <tr>
    <td align="left">Fully qualified Filename to upload:</td>
    </tr>
    <tr>
    <td align="left"><input name="file" type="file" size="50"></td>
    </tr>
    <tr>
    <td align="left"><input type="Submit" value="Upload File"></td>
    </tr>
    <table>
    </FIELDSET>
    </form>
    <SCRIPT LANGUAGE="JavaScript">
    // Begin client side helper functions
    function validateForm(form)
    if (isEmpty(form.file)) return false;
    return true;
    function isEmpty(textcontrol)
    str = textcontrol.value
    for (i = 0; i < str.length; i++)
    chr = str.substring(i, i + 1);
    if (chr != ' ')
    return false;
    return true;
    </SCRIPT>
    </BODY>
    </HEAD>
    null

  • Uploading Files Using InputFile Component -- Sometimes not working

    Hello,
    This is the 2nd time I make a post about it!
    Because I have more than 1 application using upload, and everything is correct! But it doesn't work as it should!
    You can check the original post here: Uploading Files Using InputFile Component - Sometimes not working
    I need a solution please!
    The only thing we can conclude is that it could be a bug from oracle !!! (???) But I talked with other people and they say that it works fine for them.
    There is one important thing: when we put a form to "Uses Upload = true" it seems that the page doesn't work very normal. For exemple: if you use a table in a form that uses upload the table get's "crazy".
    Thanks,
    JP

    I have now access to METALINK!
    I can find some problems and patches about inputFile but not mine! I will check better later!
    I think the problem is caused because of my framework!

  • Attempting to upload files using the zend _file_transfer system from cs5 training from the source. [was: Question for David Powers]

    I am attempting to upload files using the zend _file_transfer system from cs5 training from the source.
    On trying to upload to a remote server I am having trouble with the destination setting (C:/upload_test) in the example, please could you point me in the right direction for the an example of this setting for a remote file transfer
    Also do I have to construct a connection file to activate a Ftp file transfer?
    David Woolston

    >I am on windows platform
    Who is your host? When you checked your host path in your host control panel, what did it say?
    >i have assumed (may be incorrectly) that the purpose of the exercise was to upload to a remote site (ie my website)
    That is correct.
    >Of course that upload might take place on a computer that does not have DW installed (an internet cafe for example)
    That's irrelevant. DW is just the tool you are using to build your site. The site runs on your hosting accounts servers. This includes the php scripts you are working with.
    >I have uploaded all files necessary for the operation, when i click upload it returns no such directory exits.
    Do you have a url we can check? What destination are you specifying in zend code?
    >This made me suspect that I would need to construct a ftp file transfer connection file to satisfied username, password , connection address etc
    The exercise you are dealing with is using http file transfer. This has nothing to do with FTP. You do not need FTP for this, other than using it to move your source code from your local client to your server.

  • Upload file using jsp

    hi all i am trying a code that uploads file to the server using jsp the code goes like this
    <%@ 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 = "07ics01/jsp/"; //is this the folder where i intend to save the file?
          fileOut = new FileOutputStream(folder + saveFile);
          fileOut.write(dataBytes);
          fileOut.write(dataBytes,startPos,(endPos-startPos));
          fileOut.flush();
       catch(Exception e)
          out.println(e);
       finally
          try
             fileOut.close();
          catch(Exception err)
    %> i have been trying to use this code but i can't understand the code. is String folder = "07ics01/jsp" the folder where i intend to save the page on the server? because when i do that i get an exception like
    java.io.FileNotFoundException: 07ics01/jsp/C:\Documents and Settings\s9sharma\Desktop\tt\commons-digester-1.8\commons-digester-1.8.jar (No such file or directory) where C:\Documents and Settings\s9sharma\Desktop\tt\commons-digester-1.8\commons-digester-1.8.jar is the file i am trying to upload to the directory 07ics01/jsp which is a unix directory.
    Can anyone please help..

    So you've copypasted this code from somwhere and are expecting our support on the code, instead of the author's support? That's sad.
    I recommend you to look to the Apache Commons FileUpload API [1]. Then you don't need to write (or copypaste) a multipart parser yourself. Putting business logic in JSP files is also bad practice by the way. Use Java classes for it instead (Servlets, Filters, Beans, Utilityclasses, etc).
    [1] http://commons.apache.org/fileupload/
    To understand the actual code, it might help a lot to first read and understand the HTML spec about multipart request data and read the API documentations of the Java classes involved, e.g. the java.io API.

  • Scaning uploaded file using java

    hi All,
    I want scan an uploaded file for viruses.i there is any JAVA API where i can connect to Scan engine.
    i have gone through the Symantic scan engine. where it provides the ICAP protocol to communicate with ScanEngine but i dont know how to communicate with that using java
    Thanks
    Prashanth k p

    Hi Prashant,
    I also have the similar requirement. ie., I want scan an uploaded file for viruses. I am also using Symantec Norton Anti-Virus. I am not successful in implementing it.
    can i know how you have satisfied this requirement.
    Thanks in Advance.
    Raghavendra L

  • Uploading files using FTP(Linlyn class)

    I'm currently learning java right now on my own, and I'm having some trouble.
    I'm trying to upload a txt file using the linlyn class. How do you create a file then upload it on an applet?

    I'm currently learning java right now on my own, and I'm having some trouble.
    I'm trying to upload a txt file using the linlyn class. How do you create a file then upload it
    from an applet?

  • How can i upload file using ajax post request and jsp

    Hi
    this is my code files
    addPhoto.jsp
    <html>
    <head>
    <title>Add Photo</title>
    <script>
    var optionNo = 0;
    var i=1;
    var val=0;
    var file = 0;
    var exten = new Array(".jpg",".jpeg",".gif");
    function addValues()
         for(var i=0;i<5;i++)
              optionNo += 1;
              oNewOption = new Option();
              oNewOption.text = optionNo;
              oNewOption.value = optionNo;
              addSelect.add(oNewOption);
    function addBoxes()
         var str = "";
         var j=0;
         val = document.getElementById('addSelect').value;
         for(j=1; j<= val; j++)
              str = str + '<font size=3>file:' + j + '</font>';
              str = str + '<input type="file" id=filepath'+ j +' name=file'+ j + ' onchange="uploadFile(hidden'+ j + '.value)"><div id="result'+ j +'"></div>
              str = str + '<input type="hidden" name="hidden' + j + '" value=' + j +'>';
         document.getElementById('addPhoto').innerHTML = str;
    function uploadFile(value)
    var str = "filepath" + value;
    file = value;
    var param = document.getElementById(str).value;
    var parameter = "filepath=" + param;
    alert(parameter.length);
    if(checkValidity(param))
    var url = "uploadFile.jsp";
    if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    req.open("POST", url, true);
    req.setRequestHeader("Content-type", "multipart/form-data");
    //req.setRequestHeader("Content-length", parameter.length);
    req.setRequestHeader("Connection", "close");
    req.onreadystatechange = callback;
    req.send(null);
         else
              document.getElementById("result" + file).innerHTML = "upload .jpeg,.jpg,.gif Files Only";
    function callback() {
    if (req.readyState == 4) {
    updatepage(req.responseText);
    function updatepage(str){
         document.getElementById("result" + file).innerHTML = str;
    function checkValidity(str)
         var i=0;
         var j=0;
         var str1 = str.substring(str.lastIndexOf("."),str.length);
         alert(str1);
         for(i=0;i<exten.length;i++)
         if(str1.search(exten) != -1)
              j++;
              break;
         if(j>0)
              return true;
         else
              return false;
    </script>
    </head>
    <body onload="addValues()">
    <h5>Add Photo(s)</h5>
    <select id="addSelect" name="addSelect" onchange="addBoxes()">
    <option id="select" selected>Select</option>
    </select>
    <div id="addPhoto"></div>
    </body>
    </html>
    uploadFile.jsp
    <%@page import="java.io.*"%>
    <%
    /*try
    String contentType = request.getContentType();
         System.out.println(request.getMethod());
         System.out.println("Content type is :: " +contentType); 
         if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
              DataInputStream in = new DataInputStream(request.getInputStream());
              DataInputStream in1 = in;
              int formDataLength = request.getContentLength();
    System.out.println(formDataLength);
              byte dataBytes[] = new byte[formDataLength];
              int byteRead = 0;
              int totalBytesRead = 0;
              while (totalBytesRead < formDataLength)
                   byteRead = in1.read(dataBytes, totalBytesRead, formDataLength);
                   totalBytesRead += byteRead;
              out.println("<br>totalBytesRead : " + totalBytesRead + " : formDataLength = " + formDataLength);
         } catch(Exception e) {
              e.printStackTrace();
         try
         String filePath = request.getParameter("filepath");
         System.out.println(filePath);
         File f= new File(filePath);
         String path = f.getName();
         String contentType = request.getContentType();
         System.out.println(contentType);
         //InputStream in = new FileInputStream(filePath);
         DataInputStream in = new DataInputStream(request.getInputStream());
         int formDataLength = request.getContentLength();
         System.out.println(formDataLength);
    byte[] buf = new byte[1024];
    OutputStream out1 = new FileOutputStream("c:/docs/" + path);
    int len;
    while ((len = in.read(buf)) > 0) {
    out1.write(buf, 0, len);
    in.close();
    out1.close();
         out.write("File Uploaded SucssesFully");
    catch(Exception e)
         e.printStackTrace();
         out.write("error while Writing File");
    %>
    the above code in request.getContentType() i am getting 0. I am not passing the content length. for the same application with out using Ajax i am
    getting the size of file... it is very very urgent for me.. pls help me out on this...
    Any one having the code on this pls mail me the code...
    my mail id ... [email protected]
    Regards
    Ashok Kumar

    Sure, you can upload a file, using a form input element of type file. You pick this up with a servlet, though you need a special request wrapper to sort out the multi-part request you get back that way (there's a suitable package on jakarta.apache.org/commons)
    The servlet decrypts the file and can pass the results to a JSP for display.
    Don't try to do the complicated stuff in a JSP, it all gets incredibly messy, and that's not what JSPs are for.

  • Error while uploading file using wininet in c++.

    I'm going to upload text.txt file
    using wininet.
    Here is a code.
    #include "stdafx.h"
    #include "iostream"
    #include "windows.h"
    #include "wininet.h"
    #include "tchar.h"
    #include "iostream"
    #include "string"
    #include "sstream"
    #pragma comment(lib, "ws2_32.lib")
    #pragma comment(lib, "Wininet.lib")
    int main(){
    TCHAR hdrs[] = _T("Content-Type: multipart/form-data; boundary=---------------------------7d82751e2bc0858");
    TCHAR frmdata[] = _T("-----------------------------7d82751e2bc0858\r\nContent-Dis name=\"uploadedfile\"; filename=\"C:\\Users\Ahmer\Desktop\asd\test.txt\"\r\nContent-Type: text/plain\r\n\r\nfile contents here\r\n-----------------------------7d82751e2bc0858--\r\n");
    LPCTSTR accept[] = {_T("*/*"), NULL};
    HINTERNET hSession = InternetOpen(_T("MyAgent"), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
    HINTERNET hConnect = InternetConnect(hSession, _T("http://localhost/cpp/"), INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1);
    HINTERNET hRequest = HttpOpenRequest(hConnect, _T("POST"), _T("uploadfile.php"), NULL, NULL, accept, 0, 1);
    BOOL sent = HttpSendRequest(hRequest, hdrs, _tcslen(hdrs), frmdata, _tcslen(frmdata));
    if(hSession==NULL)
    cout<<"Error: InternetOpen";
    if(hConnect==NULL)
    cout<<"Error: InternetConnect";
    if(hRequest==NULL)
    cout<<"Error: HttpOpenRequest";
    if(!sent)
    cout<<"Error: HttpSendRequest";
    //close any valid internet-handles
    InternetCloseHandle(hSession);
    InternetCloseHandle(hConnect);
    InternetCloseHandle(hRequest);
    return 0;
    Here is a php file.
    move_uploaded_file($_FILES["uploadedfile"]["tmp_name"], "/FileFolder");
    there is error Error:
    HttpSendRequest.

    That's prefect, I changed only these two lines
    HINTERNET hConnect = InternetConnect(hSession, _T("localhost"), INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1);
    HINTERNET hRequest = HttpOpenRequest(hConnect, _T("POST"), _T("cpp/uploadfile.php"), NULL, NULL, accept, 0, 1);
    and now there is no error in this code but this is not uploading  file yet.
    Is there any error in the php file ? or in this line .
    TCHAR frmdata[] = _T("-----------------------------7d82751e2bc0858\r\nContent-Dis name=\"uploadedfile\"; filename=\"C:\\Users\Ahmer\Desktop\asd\test.txt\"\r\nContent-Type: text/plain\r\n\r\nfile contents here\r\n-----------------------------7d82751e2bc0858--\r\n");
    I have a file in this path 
    C:\\Users\Ahmer\Desktop\asd\test.txt\
    Thanks for you Time.

  • Unable to see the uploaded file using gos object

    Hi Experts,
    I uploaded the file to server by using the below code. But I am unable to see the uploaded file. Please help me out hot to view the uploaded files (list the file name and view the content) (i want to upload the file by getting the url as input and by clicking the button)
    Code to upload the file.
    DATA: wa_zqtc_gos_request TYPE zqtc_gos_request.
      DATA: l_attachment        TYPE swo_typeid.
      DATA: lo_gos_service      TYPE REF TO cl_gos_document_service.
      obj-objkey  = req_num.
      obj-objtype = objtype.
      CREATE OBJECT lo_gos_service.
      CALL METHOD lo_gos_service->create_attachment
        EXPORTING
          is_object     = obj
        IMPORTING
          ep_attachment = l_attachment.
    I tyied with this to view the files but the attachement link is disabled. (i want to view the files by clicking the icon-GOS icon in tool bar)
      DATA: wa_zqtc_gos_request TYPE zqtc_gos_request.
      DATA: l_attachment        TYPE swo_typeid.
      DATA: lo_gos_service      TYPE REF TO cl_gos_document_service.
      obj-objtype = objtype.
      obj-objkey = req_num.
      CREATE OBJECT manager
        EXPORTING
          is_object = obj
        EXCEPTIONS
          OTHERS    = 1.
    Please help me out how to view the file and list.
    thanks & regards
    T.Tamodarane
    Edited by: T.Tamodarane on Oct 23, 2009 9:55 AM
    Edited by: T.Tamodarane on Oct 23, 2009 9:56 AM

    Hi,
    Please post ur thred below:
    PL/SQL
    Regards
    Meher Irk

  • Problem in upload file using oreilly classes

    Hi
    I stucked on a problem......
    I want to upload file from html page....On this page I want only a upload button so that when I click on this button file will upload from my client m/c to server m/c....
    I have code n all but browse button on html page....now I want to remove this browse button n want to give the file path somewhere in the code itself........so that on html page there will only the uplod button and by click on this button file will upload from client to server.......server path already there in code.....Please do the needful
    Abhishek
    I m putting the code here:-
    FileUpload.java
    upload-FileUpload.java
    NOTE: This file is a generated file.
    Do not modify it by hand!
    package upload;
    //custom imports for FileUpload
    //add your custom import statements here
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import com.oreilly.servlet.MultipartRequest;
    import java.util.*;
    public class FileUpload extends javax.servlet.http.HttpServlet
         protected boolean create() throws java.lang.Exception
              return true;
         public FileUpload()
         {   // Constructor.
         private void unhandledEvent( String listenerName, String methodName, java.lang.Object event )
         * destroy Method
         public void destroy()
              super.destroy();
              // TODO: implement
         * doGet Method
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              System.out.println("abhishek");
              response.setContentType( "text/html" );
              PrintWriter out = response.getWriter();
              out.println("<HTML>");
              out.println("<HEAD><TITLE>FileUpload</TITLE></HEAD>");
              out.println("<BODY>");
              out.println("<H1>FileUpload</H1>");
              out.println("Hello World!");
              out.println("<P>Default Implementation From PowerJ</P>");
              out.println("</BODY></HTML>");
              // TODO: implement
         * doPost Method
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              PrintWriter out = response.getWriter();
              try{
                   response.setContentType("text/html");
                   out.println("<HTML>");
                   out.println("<head><Title>Decoded Uploaded File</title><head>");
                   out.println("<body>");
                   out.println("<H1>UploadFile</h1>");
                   // path must be absolute to upload dir
                   // This is the decoder class that extracts the parameters and transfer file
                   // request argument = Http input stream
                   // c:\\temp\\upload = directory to save file
                   // 15*1024*1024 = 15mb max size file
                   MultipartRequest multi = new MultipartRequest(request, "c:\\temp\\upload",15*1024*1024);
                   // Lists form parameters
                   out.println("Params:");
                   Enumeration params = multi.getParameterNames();
                   out.println("<pre>");
                   while (params.hasMoreElements()) {
                        String name = (String)params.nextElement();
                        String value = multi.getParameter(name);
                        out.println(name + " = " + value);
                   out.println("</pre>");
                   // Show details of uploaded file
                   out.println("Files:");
                   Enumeration files = multi.getFileNames();
                   out.println("<pre>");
                   while (files.hasMoreElements()) {
                        String name = (String)files.nextElement();
                        String filename = multi.getFilesystemName(name);
                        String type = multi.getContentType(name);
                        File f = multi.getFile(name);
                        out.println("name: " + name);
                        out.println("filename: " + filename);
                        out.println("type: " + type);
                        if (f != null) {
                             out.println("f.toString(): " + f.toString());
                             out.println("f.getName(): " + f.getName());
                             out.println("f.exists(): " + f.exists());
                             out.println("f.length(): " + f.length());
                             out.println();
                        out.println("</pre>");
              }catch (Exception e){
                   out.println("<pre>");
                   e.printStackTrace(out);
                   out.println("</pre>");
              out.println("</body></html>");
         * init Method
         public void init(ServletConfig config) throws ServletException
              super.init(config);
              // TODO: implement
         * data members
    //     add your data members here
    UploadFile.html
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>File Upload using EAS</title>
    </head>
    <body>
    <form method="POST" enctype="multipart/form-data" action="upload/FileUpload">
    <p><b>File Upload using EAS </b></p>
    <p>Select file to send: <input type="file" name="name" size="30"></p>
    <p>Your Name: <input type="input" name="yourname" size="20"> </p>
    <p align="left"><input type="submit" value="Send File" name="submit"></p>
    </form>
    </body>
    </html>
    You can download the oreilly files from :- (same code is also here)
    http://www.sybase.com/detail?id=1011664

    where I should write down the file path(The file in client pc....e.g. C:\Documents and Settings\abhishek.jain\Desktop\Daily Order Manual.pdf ) in code........I m getting stuck

  • Need to send mail & upload files using JSP

    hi, got a lot of issues,.. just starting out as a developer.. so here goes.
    1st Need to send mail & upload files to server using JSP(tomcat).. an example to demo it would be nice.
    thanx in advance

    Look at this for email:
    http://forum.java.sun.com/thread.jspa?forumID=45&threadID=285950
    and go to:
    http://servlets.com/cos/
    for a package to upload files.

Maybe you are looking for