Uploading a file, renaming it and placing it in a particular location on server

A user submits a file from a front end HTML form which has fields like Division, Department name, department number,
section number, year, email, phone etc. The file being submitted might have a user given name. But, when it is 
uploaded I want it to be named as Departmentname_departmentnumber_sectionnumber. So, if department is Accounting, 
dept number is 123 and section is 1, name of file will be Accounting_123_1.doc The extension will be whatever type 
of file(text, MS-Word's .doc or .docx, PDF or RTF) was submitted and the user can upload attachments of files with 
extension .txt, .doc, .docx, pdf, rtf only.
Also, I want it to be stored on a particular location on server. So, if Division is Corporate Finance and year is 
2011-2012 it should be stored on server at "E:\Files Submitted\2011-2012\Corporate Finance\". The "E:\Files
Submitted\" part remains same in the directory name.
<cfset submittedfileName =
#form.departmentname#&"_"&#form.departmentnumber#&"_"&#form.section_number_1#&"."&#cffile. ClientFileExt#>
<cfset filedirectoryYear = "E:\Files Submitted\"&#form.current_year#&"\"&#form.division#&"\">
<!--- ensure that the user uploads attachments of type with extension .txt, .doc, .docx, pdf, rtf only--->
<cfif FORM.attachment_1 neq "">
       <cffile action="upload"
               accept="text/plain,application/msword,application/pdf,application/rtf"          
                 filefield="attachment_1"
                 destination="E:\temp\uploads"
                 nameconflict="Makeunique"
        >
<!--- rename the file and move it to permanent destination --->        
        <cffile
  action="rename"
  source="E:\temp\uploads\#cffile.serverFileName#"
  destination=#filedirectoryYear#&#submittedfileName#&#cffile.ClientFileExt#
  >
<!---   now create a temporary variable for the attachment so that it can be emailed later on --->
<cfset attachment_local_file_1 = #filedirectoryYear#&#submittedfileName#&#cffile.ClientFileExt#>
</cfif>
I used the cffile.ClientFileExt because the files were getting uploaded without the extension but am receiving an
error at   destination=#filedirectoryYear#&#submittedfileName#&#cffile.ClientFileExt# as "multiple items at this
position: Missing Token > or /> .
I am using Coldfusion 8. Any suggestions would be appreciated on where I am erring and how I can fix it.

Thanks Dan,
The space between 'l' and 'e' was a formatting error while I was pasting text to this forum.
Currently, I have
<cfset filedirectoryYear = "E:\Files Submitted\"&#form.current_year#&"\"&#form.division#&"\">
<cfif FORM.attachment_1 neq "">
       <cffile action="upload"
               accept="text/plain,application/msword,application/pdf,application/rtf "          
                 filefield="attachment_1"
                 destination="E:\temp\uploads"
                 nameconflict="Makeunique"
        >
<!--- rename the file and move it to permanent destination --->        
<cfset submittedfileName =
#form.departmentname#&"_"&#form.departmentnumber#&"_"&#form.section_number_1#&"."&#cffile. ClientFileExt#>
<cfset presentfileName = #cffile.serverFileName#&"."&#cffile.ClientFileExt#>
        <cffile
  action="rename"
  source="E:\temp\uploads\#presentfileName#"
  destination=#filedirectoryYear##submittedfileName#
  >
<!---   now create a temporary variable for the attachment so that it can be emailed later on --->
<cfset attachment_local_file_1 = #filedirectoryYear#&#submittedfileName#&#cffile.ClientFileExt#>
</cfif>
<cfset attachment_local_file_1 = #filedirectoryYear#&#submittedfileName#>
When I submit, I get the error message
"Attribute validation error for tag CFFILE.
The value of the attribute source, which is currently c:\Course Syllabi\uploads\Web Based System Two Page HandOut.pdf, is invalid and the line below is referred.
destination="#filedirectoryYear##submittedfileName#"
The filedirectoryYear path exists i.e. I have E:\Files Submitted\2011-2012\Finance. What could be the issue?
P.S. I got it working, The filedirectoryYear path value was not the actual directory path\name in the filesystem. Once I had the
correct name in the filesystem, the application worked fine.

Similar Messages

  • How to upload a file which may contain text as well as image to the server using windows phone 8 application ?

    How to upload a file which may contain text as well as image  to the server using windows phone 8 application ?

    You're going to need to give way more detail about the situation before we can help.

  • Uploading par files in nwds and deploying back

    Hi all,
    I wanted to work with the masthead iview in nwds, so found it on the server as the par file and imported it into NWDS. Changed the headeriview jsp and deployed it back to the portal. But it is not working. Saw in another sdn thread that when you create the project in nwds, it does not bring up all the components from the par file as required and some class files are missing. I think this is the problem in my case. The solution to it was not given in that thread.
    Would anybody help please.
    thanks.
    Lm

    Hi
    the following are the steps to modify a masthead.
    1.Find the PAR file and copied to a temporary directory and renamed to the customer namespace taking off .bak extension.
    2.Import the PAR file now using File->import option.
    3.make necessary modifications.
    4.once the JSP is edited, the PAR file needs to be created ans uploaded to the portal.If JDK is installed just login into portal and deploy the pAR file otherwise use PortalAnywhere to deploy it.
    5.Now goto Content Administration->Portal Content->right click the folder you wish to create the mastheadiView.Select New from Portal Archive-?iView from the context menu.Select new masthead.
    6. select poratal component Default and choose next.
    7.enter the properties for masthead and next.
    8.edit the Iview and saved it.
    9.add the iView to Framework Page in portal catalog and edit page layout.
    10.select iView from catalog and add it as Delta link and position it accordin to your need.
    Hope this helps you to modify the masthead.
    Regards
    Victoria

  • Unable to upload a file with Drag and Drop and http

    Hello,
    I am trying to upload a file through the web interface (Netscape 4.7 and IE 5.0). When I click un upload, Via Drag and Drop, a new window is started, but never completes.
    With Netscape, I get a message box: Netscape is unable to locate the server null. Please check the server name and try again.
    With IE 5, I get an error: This page can not be displayed.
    Are there any files I need to edit on the PC side to get this to work?
    Thanks
    Scott
    PS I think you guys are doing a great job with support on iFS.

    WebUI Drag & Drop requires FTP to be running and available.
    Drag & Drop is really just uses the browser built in FTP ability.

  • Uploading - skipping files across platforms and version numbers

    I'm using Dreamweaver CS3 on XP.
    I've had a problem with Dreamweaver's FTP feature for several
    months now. I will try to upload a file, and only about 1/4 of the
    time, will it upload successfully.
    I will sometimes get a message saying: "Some files were
    skipped during the last operation. A list of these files has been
    logged in the FTP log window". Then, that file, (index.html, for
    instance) will be deleted from the server. Often, it takes 7-10
    tries to just upload one file.
    other times, I'll get this error message instead "There was
    no response from the server while transferring the file
    "index.html" 2 attempts made" It doesn't matter whether i click
    "Try Again" or hit "Cancel" and try it again manually... still,
    only about 1/4 of the time it's successful.
    In the FTP log, this is what it says, for instance: (This is
    just 1 example... it's happening across all 45 sites i manage)
    =======================================
    < 230 user logged in
    > PWD
    < 257 "/ksmk.org" is current directory
    > PWD
    < 257 "/ksmk.org" is current directory
    The file "/ksmk.org/index.html" was skipped because the old
    remote file could not be deleted.
    =========================================
    Fixes I've tried: re-setting my firewall to allow dreamweaver
    access. using passive FTP. using ipv6 transfer mode. the only thing
    that seemed to work was deleting the setting of "Home Page" under
    the "Site Map Layout" tab in Advanced Settings. it would work
    flawlessly up to 2 or 3 times. But then, that setting would
    automatically be populated again, and i'm back to square one. I'm
    not going to go into the settings every time i want to upload
    something!
    I gave up, and started using WS FTP instead. a pain, because
    i really like Dreamweaver's FTP better, but WS FTP is better than
    the frustration. i figured i was just doing something stupid.
    But now, my brother in Texas, on Vista and CS4 is having the
    same exact problems. and, my friend 20 miles away on XP with CS3 is
    as well. so it's not just my problem. It's happening across ISP's,
    platforms, servers... every variable except Mac. I've been fine
    using dreamweaver on Macs... possibly just a PC issue?
    any ideas and suggestions would be gladly appreciated.
    thanks
    -Andrew Latham.

    HI Ron,
    I am not sure, but the small files might be the resource forks of the photos.
    I know when I send photos to PC friends that I make sure the resource fork is removed from the photos before I send them other the recipient will get two diles in the email. One the resource fork and the larger is the photos.
    You might try exporting the photos from iPhoto to a folder on the desktop. From there you can use a program to delete the resource forks from the photos.
    You can then copy that folder of photos to the media player.
    There are different methods to do this.
    1-usings X-ray
    http://www.versiontracker.com/dyn/moreinfo/macosx/12103
    2-I have used GrimReeper in the past. It is a contextual menu plugin.
    Check out this page for more info
    http://kb.iu.edu/data/aefq.html
    You also might like to check out a newer app called Blue Harvest
    http://www.versiontracker.com/dyn/moreinfo/macosx/28432&vid=271175

  • Problems uploading big files via FTP and downloading files

    I've been having problems uploading big files like video files (.mov 12MB) via FTP to my website (small files like .html or .doc I can upload but it takes longer than usual). I'm using Fetch 4.0.3. as FTP. Same problems when downloading files via Bit Torrent. I recently moved to Spain, since then I seem to have the problem. But my roommate with a PC doesn't have that problem. Connecting to internet with Ethernet cable also didn't resolve the problem. I also tested it from a Starbucks coffee connecting to Internet from there but still couldn't upload that 12MB file to the FTP. The security settings for firewall are set to "allow all incoming connections". I didn't change any of my settings so I don't know what the problems could be. I have a MacBook Pro, Mac OS X (10.5.7) Any suggestions? Thanks!

    Welcome to Apple Discussions!
    Much of what is available on Bittorrent is not legal, beta, or improperly labelled versions. If you want public domain software, see my FAQ*:
    http://www.macmaps.com/macosxnative.html#NATIVE
    for search engines of legitimate public domain sites.
    http://www.rbrowser.com/ has a light mode that supports binary without SSH security.
    http://rsug.itd.umich.edu/software/fugu/ has ssh secure FTP.
    Both I find are quick and a lot more reliable than Fetch. I know Fetch used to be the staple FTP program, but it grew too big for my use.
    - * Links to my pages may give me compensation.

  • When uploading large file from network, all other requests are not being sent to server

    In our application we are facing a weird scenario in which when we try to upload a huge file(600+ MB) from network, all other requests(AJAX) are getting blocked. But when the same file is being uploaded from local location(E drive) then everything works fine.

    How are you uploading the file via network?
    If you are troubleshooting the network bandwidth? or the threads where one process takes precedent over the other you will have to troubleshoot the QoS of the network you see this on.
    To give a better visual please use Firebug or the Web Developer tool called Network to analyze the requests. The "XMLHttpRequest" will give better clues for Ajax. Reference [http://ajaxian.com/archives/ajax-debugging-with-firebug]
    There may be a about:config option that allows mutithreading or max persistent connections per server you can check.

  • Uploading a file using jsp and com.oreilly.servlet lib package

    Sorry to bother you but I need your help folks
    I am developing an application to pick up files from a database and sent to a specified location on a different system.
    I am presently trying to run this code,I have placed this lib package from oreilly which is supposed to encapsulate the usage of file uploads,which is a jar file called cos.jar into C:\Program Files\Java\jdk1.5.0_03\jre\lib\ext folder .I have a jsp page that calls the bean which does the upload and implement the classes in the oreilly package.I am using tomcat 5
    [b]the jsp page that acts as the user interface
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Please Choose The File</title>
    </head>
    <body bgcolor="#ffffff">
    <table border="0"><tr>
    <form action="Upload.jsp" method="post"
    enctype="multipart/form-data">
    <td valign="top"><strong>Please choose your document:</strong><br></td>
    <td> <input type="file" name="file1">
    <br><br>
    </td></tr>
    <tr><td><input type="submit" value="Upload File"></td></tr>
    </form>
    </table>
    </body>
    </html>
    this is the jsp page that calls the bean
    <jsp:useBean id="uploader" class="com.UploadBean" />
    <jsp:setProperty name="uploader" property="dir" value="<%=application.getInitParameter(\"save-dir\")%>" />
    <jsp:setProperty name="uploader" property= "req" value="${pageContext.request}" />
    <html>
    <head><title>file uploads</title></head>
    <body>
    <h2>Here is information about the uploaded files</h2>
    <jsp:getProperty name="uploader" property="uploadedFiles" />
    </body>
    </html>
    [b]this is the bean class
    package com;
    import java.util.Enumeration;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.ServletRequest;
    import com.oreilly.servlet.MultipartRequest;
    import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;
    import javax.servlet.*;
    public class UploadBean {
    private String webTempPath;
    private HttpServletRequest req;
    private String dir;
    // private ServletRequest request;
    public UploadBean( ) {}
    public void setDir(String dirName) {
    if (dirName == null || dirName.equals(""))
    throw new IllegalArgumentException("invalid value passed to " + getClass( ).getName( )+".setDir");
    //webTempPath = dirName;
    dir = dirName;
    /* public String getDir()
    return webTempPath;
    public void setReq(ServletRequest request) {
    if (request != null && request instanceof HttpServletRequest)
    req = (HttpServletRequest) request;
    } else {
    throw new IllegalArgumentException("Invalid value passed to " + getClass( ).getName( )+".setReq");
    public String getUploadedFiles( ) throws java.io.IOException{
    //file limit size of 5 MB
    MultipartRequest mpr = new MultipartRequest(req,dir,5 * 1024 * 1024,new DefaultFileRenamePolicy( ));
    Enumeration enume = mpr.getFileNames( );
    StringBuffer buff = new StringBuffer("");
    for (int i = 1; enume.hasMoreElements( );i++){
    buff.append("The name of uploaded file ").append(i).append(" is: ").append(mpr.getFilesystemName((String)enume.nextElement( ))).append("<br><br>");
    }//for
    //return the String
    return buff.toString( );
    } // getUploadedFiles
    On running the code I find this error messages
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: javax/servlet/ServletRequest
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.jsp.Upload_jsp._jspService(org.apache.jsp.jsp.Upload_jsp:73)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
         com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:222)
         com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:151)
         com.UploadBean.getUploadedFiles(UploadBean.java:49)
         org.apache.jsp.jsp.Upload_jsp._jspService(org.apache.jsp.jsp.Upload_jsp:63)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    Apache Tomcat/5.5.9
    tanks

    Hi,
    Looks like you are missing a file from the classpath. Make sure servlet.jar is available in your classpath. Ordinarily files in <tomcat_home>/lib directory should be added automatically. You need to check why it hasn't been added in your case. A good place to start would be the bat files in the bin directory viz startup.bat, catalina.bat etc.
    cheers,
    vidyut

  • How to upload pdf file in iphone and how to view

    how to upload and how to view pdf file in iphone 5s

    Hey saif.antri,
    You can view PDFs and more using iBooks on your iPhone:
    iBooks: Viewing, syncing, saving, and printing PDFs on iPhone, iPad, and iPod touch
    http://support.apple.com/kb/HT4227
    Have a great day,
    Delgadoh

  • TS4522 I have a finished project, but Final Cut Pro has grayed out the export option. How do I fix this to upload my file to youtube and burn dvds?

    Hi guys, I really need help trying to figure out why Final Cut Pro will not allow me to export my project. I have done this in the past and had no problems at all with other projects, and I have done nothing different from what i can tell. Any help???

    Hey Tom,
    Thankyou for your help. No, I have done this and it does not work. I have tried clicking and dragging, selecting the file in the project library, selecting individual files etc etc etc. The only thing that may have helped me out was last night...I clicked on a tab in FCP on the far right side (that must have something to do with exporting as well) and a small screen popped up after clicking it stating i cannot export the file while it is still referencing media off of the camera. I dont understand this either? I do have to have my camera connected before FCP will RECOGNIZE the media clips, but they have all been imported to my external hard drive and once i click import from camera, it is complete within seconds, so the hundreds of video clips i am using are obviously saved on there somewhere already....im at a loss here as to what to do. Do i have to literally download ALL MEDIA in each project to my computers hard drive before final cut pro will allow me to export any of the projects i create?? This seems like such backward thinking...I dont have nearly enough room on my computers intenal memory to do this with all my video clips!!!

  • Upload any file and view files withflex and java

    HI
    I need to upload any files using flex and server side code in
    java.
    and need to view files like pdf and MS word by flex and
    java/jsp .
    Please help us in resolving this issue.
    Thanks In advance
    Nirmal Kumar R

    You can find an uploadComponent here:
    http://weblog.cahlan.com/2006/12/flex-upload-component.html
    regards - Michael

  • Upload 2 files and compare its contents

    Hi guys,
    I want to upload 2 files in SAP and compare its contents.
    How am i going to do that?
    Please provide sample code... Thanks a lot!
    rgds,
    Mark

    Hi Mark,
    I expected to use this code, once u can try this code.
      OPEN DATASET lv_filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc = 0.
        LOOP AT gi_output1 INTO gwa_output1.
          CLEAR lv_string.
          CONCATENATE gwa_output1-matnr
                      gwa_output1-maktx
                      gwa_output1-werks
                      gwa_output1-bmeng
                      gwa_output1-posnr
                      gwa_output1-idnrk
                      gwa_output1-ojtxp
                      gwa_output1-mngko
                      gwa_output1-mmein
                      gwa_output1-flag
                      INTO lv_string
                      SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
          TRANSFER lv_string TO lv_filename.
          IF sy-subrc <> 0.
            MESSAGE e006(zpdm).
          ENDIF.              "if sy-subrc <> 0.
        ENDLOOP.
         OPEN DATASET lv_filename FOR appending IN TEXT MODE ENCODING DEFAULT.
      IF gi_output2[] is not initial.
        LOOP AT gi_output2 INTO gwa_output2.
          CLEAR lv_string.
          CONCATENATE gwa_output2-matnr
                      gwa_output2-ojtxb
                      gwa_output2-werks
                      gwa_output2-bmeng
                      gwa_output2-posnr
                      gwa_output2-idnrk
                      gwa_output2-ojtxp
                      gwa_output2-mngko
                      gwa_output2-mmein
                      gwa_output2-flag
                INTO  lv_string
           SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
          TRANSFER lv_string TO lv_filename.
          IF sy-subrc <> 0.
            MESSAGE e007(zpdm). " WITH text-006.
          ENDIF.           "if sy-subrc <> 0.
        ENDLOOP.
      ENDIF.

  • Office 365 Files REST API and chunked upload

    Hello,
    I am currently working on integration with OneDrive for Business and I need to upload large files in chunks. I need to do something like  this but using
    the O365 Files REST API. As far as I understand this is currently not supported.
    Are there any plans to support
    uploading in chunks? If yes, can you please provide some (rough) estimate?
    Thanks
    Andrey

    Thank you for the quick answer!
    We are trying to upload the files using javascript and we are currently working with this API:
    https://msdn.microsoft.com/en-us/office/office365/api/files-rest-operations
    We have also noticed that the roadmap for Office 365
    http://roadmap.office.com/en-us contains SharePoint API Partial File Upload Support. 
    Does the update pointed in the roadmap refer to the API we are using? Or if you are saying we can already do chunked upload using it, can you please point us to a working sample?
    Thanks
    Andrey

  • Upload .txt file into Database Table

    Hi,
    I was wondering if someone could please point me in the right direction. I've been looking around the forum but can't find anything to help me achieve the following.
    I would like to be able to upload a .txt file using a webpage. Then store the information inside this file into database tables.
    eg. contents of mytextfile.txt:
    richard
    10 anywhere street, anytown, somewhere
    111 222 333 444
    joe
    9 somestreet, elsewhere
    999 888 777 666
    peter
    214 nearby lane, overhere
    555 555 555 555
    I would like to insert this data into a table.
    eg. table name = CONTACTS
    userid = primary key (using sequence)
    username = (line 1 - richard, joe, peter)
    address = (line 2)
    phone_no = (line 3)
    As you can see the records will appear 1 at a time and will have a blank line between records. Is there anyway for me to upload a file like this and have it placed into tables?
    I have seen http://otn.oracle.com/products/database/htmldb/howtos/howto_file_upload.html but this seems to be for uploading a whole file and downloading the same file, rather than extracting data from the file.
    I hope I have managed to explain my problem.
    Many thanks,
    Richard.

    Richard,
    HTML DB allows you to upload CSV files via the Data Workshop. That data would then be parsed and inserted into a specific table. Alternatively, if you have your data in an Excel spreadsheet, and it is less than 32k, you can copy & paste the data directly into HTML DB's Data Workshop, which will then parse and import it into the Oracle database.
    The one obstacle you may have to overcome is converting your data from the format you outlined to CSV format. Specifically, you would have to make this:
    richard
    10 anywhere street, anytown, somewhere
    111 222 333 444
    Look something like this:
    "richard","10 anywhere street, anytown, somewhere","111 222 333 444"
    Hope this helps,
    - Scott -

  • Problem when I upload txt files to the server

    Hi, I have a problem when I try to upload files to the server, and I can't understand the fail.
    My case is:
    I have a jsp page where a from is.
    This form is sended to a servlet that proccess its content and upload the attach file to the server.
    It works correctly (it uploads the files, txt, xls and csv), the problem is when I try to upload a txt file like this, for example:
    Depth     Age
    0     0,1
    2     0,9
    3     2
    5     6
    6     9
    8     12
    34     25
    56     39
    101     40When I verify the uploaded file, this one has a character extra of return of line (a small square). This character prevents me from working then correctly with the file, on having detected a column of more.
    Which can be the problem?
    The code I use to uploaded the file is:
    try
        MyConnection Objconnection = new MyConnection();
        boolean isMultipart = FileUpload.isMultipartContent(req);
        // Create a factory for disk-based file items
        FileItemFactory factory = new DiskFileItemFactory();
         // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload(factory);
        // Set overall request size constraint
        upload.setSizeMax(1024*512); //524288 Bytes (512 KB)
         // Parse the request
        List items = upload.parseRequest(req);
        // Process the uploaded items
        Iterator iter = items.iterator();
        String dat = new String();
        String typeFile = new String();
        while (iter.hasNext())
            FileItem item = (FileItem) iter.next();
            if (item.getFieldName().equals("typeFile") )
                typeFile = item.getString();
            if (!item.isFormField())
            String fieldName = item.getFieldName();
            String fileName = item.getName();
            String contentType = item.getContentType();
            boolean isInMemory = item.isInMemory();
            long sizeInBytes = item.getSize();
            int numbers=0;
            for(int i=fileName.length();(i=fileName.lastIndexOf('\\',i-1))>=0;)
                 numbers++;
            String stringFile[] = fileName.split("\\\\");
            HttpSession session = req.getSession(true);
            String loginSesion = (String)session.getAttribute("UserLogin");
            String newUserFolder = loginSesion;
            File createFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/"+newUserFolder);
            if ("AgeModel".equals(typeFile))
                createFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/AgeModels/"+newUserFolder);
            if (!createFile.exists())
                createFile.mkdir();
            fileName = stringFile[numbers];
            File uploadedFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/"+newUserFolder+"/"+fileName);
            if ("AgeModel".equals(typeFile) )
                uploadedFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/AgeModels/"+newUserFolder+"/"+fileName);
            existe = Objconnection.existFile(fileName, typeFile, loginSesion);
            if ( true == existe )
                 exito = false;
            else
                item.write(uploadedFile);
                ....// NOW REGISTER THE FILE IN TH DATA BASE
        } // if (!item.isFormField())
    } // WHILE ( iter.hasNext() )
                catch(Exception e) {
                out.println("Error de Aplicaci�n " + e.getMessage());
                return exito;
    ...THANKS

    Hi,
    Sorry I am aware this question was posted way back, but I am having similar problem and haven't been able to find the fix yet.
    So please let me known if you have got any ideas.
    My problem is same that I have to upload a CSV file from Client Machine (Windows) to Unix Application Server.
    I am using JSP method post and multipart/form-data (as in http://www.roseindia.net/jsp/file_upload/Sinle_upload.xhtml.shtml).
    The file is uploaded fine but the problem is it displays carraige Return (^M) a square boxes on Unix file.
    I can't ask user to convert file to Unox format before uploading. They just convert excel file to CSV and upload.
    Is there any way I can get rid of these characters as I have to use this file further.
    Sorry, I can't use any paid utility or tool for it.
    I would appreciate if you could please help.
    Thanks,
    SW

Maybe you are looking for