File download from client to server

I am trying to set up a JSP/servlet to download a file from the client to the server in a webapp.
The solution I thought about was to post a form using a <INPUT TYPE="file" > element
But this does not work! In the form, I am setting the encoding to ENCTYPE="multipart/form-data" and I am wondering if that causes the problem.
Is it possible to do what I want to do? Am I doing it the right way?
Thanks

hi hacot
u can do it by using a servlet. In your html form u have done the rigth thing (INPUT TYPE and ENCTYPE).this ENCTYPE will take care of the input data and convert it into a stream. capture this flow of stream using a servlet's getInputStream() method. Detect the header part and the body part of that stream...and try to print the body part in the console and u will get an idea , about how to parse the stream's body part.

Similar Messages

  • How to Serialize a file path from client to server?

    I am using serializing concepts in java. I am stuck, that how can i send only file path from client to server?

    Um, ill take a wild guess and say that youre trying to
    access a file on another computer using that path?
    That wont work.
    What could the other computer possible do
    with that path unless both computers are networked to a
    common drive, or if they are networked to each other in a way
    where the root in the file path would point to the same place
    on either computer?

  • Save media file captured from client to server

    Hi all,
    I need to capture webcam at client side and save it to the server.
    I am thinking of two solution:
    1) save file to client computer then upload to server.
    2) streaming to server simultaneously while capturing.
    If I choose the second method, I should you the RTP feature right (I don't have exp with it)? Or the first method is better?
    Thanks you all
    Regards
    K.

    If your usage scenerio doesn't involve the word "live" then you want to avoid anything that involves the term "real-time" as any actual real-time system intentionally drops data anytime the processing gets behind.
    Option 1 is going to be easier to implement, but option 2 will save the user some time. Option 1 is going to be less hardware intensive, so it really depends on whether or not you want to (1) invest more work upfront to make your program terminate faster (2) care whether or not your users have to wait there while the file uploads after the recording ends (3) want to give your users the ability to review the video before they upload it (which I would recommend for most applications).
    I'd definately just do option 1 unless you have a good reason to need option 2.

  • File download from one server does not work (other browsers work)

    After uprading to Win7 and FF 7.0.1 the file download from our intranet server stopped working. IE 9 and Chrome 14 does not have any problems. When I try to open for exmple this URL:
    https://wwwedu.oulu.fi/intra/?act=58&rnum=26241
    I got only an error page:
    Corrupted Content Error
    The page you are trying to view cannot be shown because an error in the data transmission was detected.
    The page you are trying to view cannot be shown because an error in the data transmission was detected.
    Please contact the web site owners to inform them of this problem.
    I have tested this with two separate computers and got some similar reports from students.
    If there is is problem in the headers etc. of the server, I would be very pleased to know that, too!
    Thank you very much
    Eetu Pikkarainen

    Thank you, the discussion in [https://bugzilla.mozilla.org/show_bug.cgi?id=681140 bug 681140] was informative.
    (By redbot.org I found out that there was two Content-Disposition headers. They were identical, but other one had one space character more. When they were corrected to identical then douwnload work. Now I still have to find out why there are two...)

  • File download from server

    Hi All,
    I have written a code that downloads a file from server using the following link given by Frank,
    File download from server
    I am able to get a open/save/cancel dialog with help of this. But issue is that applications of kind .doc/.xls/.ppt gets opened (If user clicks open) right in the internet explorer window instead of getting opened in a new office application....
    However .pdf runs fine.
    Can any thing be done for this???
    Any help....
    Regards,
    Amitt

    Hi,
    what do you have for the content disposition header?
    Try this:
             response.setHeader("Cache-Control", "max-age=0");
             response.setHeader("Content-Disposition", "attachment; filename=\"" + fname + "\"");
             response.setContentType("application/x-download");Brenden

  • Transfer file from client to server using http

    HI friends,
    I want to transfer files from client to server...I tried that with the help of socket and rmi..........
    But Http is only the best mechanism for my application..........
    Without using servlets, how to transfer files with the help of http.....
    Any help would be appreciated.......

    Google is your friend, and appearently www.jguru.com also:
    http://www.jguru.com/faq/view.jsp?EID=160

  • Urgent - Upload a file from Client to Server.

    Need to load a file from the client machine to the Server running 9iAS Rel. 1 on a HP Unix Machine.
    We are using Forms 6i. We have looked into the File Upload Utility demo code provided with Forms 6i - but have been unsuccessful in reusing it. PLS HELP

    Duplicate post.
    Upload a file from client to server by forms in E-Bussiness Suite R12
    Re: Upload a file from client to server by forms in E-Bussiness Suite R12.

  • Jar files downloaded from SkyDrive are being renamed to jar.zip files

    I have cut and pasted the following series of exchanges from when I posted the problem onto SkyDrive's support forum. I hope that someone might be able to propose a better solution to the problem that I have. Thanks for your help.
    MDSms asked on
    Uploaded jar files convert to jar.zip files when downloaded from SkyDrive
    I have uploaded an executable jar file to SkyDrive. (I will call this FILE.jar). The file is intact and indicates that it is a jar file type when the file is viewed by Properties within Skydrive. However, when I download (or others download through a share link) the file, it is being saved onto the local computer's download file with .zip appended to the file name (FILE.jar.zip). The downloaded file can be renamed to remove the .zip appendage and subsequently run successfully. However the folder options for the folder where the downloaded file resides must be changed for disable "Hide known file extensions" prior to being able to remove the .zip appendage. While I have figured out the workaround for this problem, this manual renaming procedure is entirely too cumbersome as a solution for sharing this file with others. How can I prevent or disable the FILE.jar file from being renamed to FILE.jar.zip when it is downloaded from SkyDrive?
    All Replies (5)
    Audrey_P. replied on
    Forum Moderator
    Hi,
    Thank you for posting. Let me try to assist you with your issue with your files.
    In order for us to reproduce the issue on our end. Please provide us with the exact steps that you did when you uploaded the files as well as the steps when you are downloading it.
    We will be needing the steps to help us figure put what is causing you this issue.
    We look forward to your response.
    Thank you.
    Audrey P.
    MDSms replied on
    Reply
    The file was uploaded by first logging onto my SkyDrive account using Windows 7 Pro and Firefox browser, then a new folder in my account was created without sharing privileges, then the folder was opened and the FILE.jar was uploaded into the folder using the "Upload" option on skydrive account menu. Sharing privileges for FILE.jar were then created (view only), and the shortened url link was sent to the individuals that I was trying to share the file with. was then turned on. When these people use the link to download the file, it is being saved as FILE.jar.zip.
    When I try to download the file through the skydrive account download option, it is being saved onto my computer as FILE.jar.zip and this occurs when I try to download the file while signed into my skydrive account as well as when I am not signed into my skydrive account (using the shared file link).
    This PNG shows the information provided by clicking on the download icon (down arrow) within the Firefox browser; note that the file was downloaded as FILE.jar.zip and that the source was live.com. When I use Windows Explorer to look at the same file within the Download folder itself, examining the file's properties details also shows that it is being saved as FILE.jar.zip and is of the file type compressed zip folder.
    This PNG shows the information displayed to me from my skydrive account when I view the originally uploaded file's properties; note that the information shows that the file is a jar file type.
    When I utilize Internet Explorer 9 to access the file, FILE.jar is being downloaded onto my computer as a jar file type. This PNG shows the information provided by Tools/View Downloads within the IE9 browser. Note that in this instance, the information indicates that the file is being downloaded from yzudea.blu.livefilestore.com.
    It appears to me that the problem (the FILE.jar file being renamed to FILE.jar.zip) arises from the fact that a jar file downloaded from skydrive using firefox, is being sent from live.com whereas a jar file downloaded from skydrive using IE9 is being sent from yzudea.blu.livefilestore.com.
    I want to make sure that a person receiving a share link from me for FILE.jar is able to download it without modification to the file name regardless of which browser is being using to access the link. How can I make sure that this occurs?
    Any help is appreciated. Thanks.
    Michelle Anne D. replied on
    Forum Moderator Community Star Community Star
    Reply
    Hi MDSms,
    I appreciate you for providing as much information as you can about the issue, as well as for uploading screenshots on what you see from the downloaded file. About your initial concern wherein the file gets renamed with .zip after the original file extension, this is solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented.
    Moreover, you may see the file servers live.com and yzudea.blu.livefilestore.com to be different with one another, but they actually are sent from the same SkyDrive server. This in turn, depends on the web browser where the file is being downloaded as well. The live.com file where it was downloaded from Firefox simply masks its original server yzudea.blu.livefilestore.com.
    As for your last query about your recipients downloading the file without the hassle of renaming it from a .zip file, you can simply tell them to download it through Internet Explorer.
    Should you have other queries or additional information that might help in our investigation, I highly encourage you to post them here.
    Regards,
    Michelle
    MDSms replied on
    Michelle,
    Thanks for your reply. Yes, I could simply tell them to download the file through Internet Explorer, but is there another solution or workaround to the problem I have described here? Am I being punished with the curse of this problem simply because I (or the individuals with which I wish to share FILE.jar with) choose to use Firefox instead of IE? Will the use of any other browser instead of IE (Chrome, Safari, etc., etc.) still result in the same problem?
    You stated that it is "solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented"........could the problem be overcome by designating one or both of the file server addresses as Trusted Sites within the browser options setting?
    I look forward to your response. Thanks in advance.
    Joy V. replied on
    Forum Moderator Community Star Community Star
    Reply
    Hi MDSms,
    We understand your concern. Since the issue does not occur in Internet Explorer, it has something to do with Firefox's security feature. You might want to verify this concern by contacting Firefox support.
    Hope this helps. Let us know if we can further assist you with SkyDrive.
    Thanks,
    Melanie Joy

    Try to delete the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
    *http://kb.mozillazine.org/mimeTypes.rdf
    *http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions

  • How to deploy Forms, Reports and Menu from Client to Server machine

    Dear Experts,
    I have one requirement to deploy the Forms, Reports and Menu from client machine to server machine.
    Deployment involves the following steps :
    1. Firstly we have to search the selected file in a folder where the .fmx is present ( in Server machine) and take the back up of the the existing file in the server (Source and destination paths will be available).
         Ex. If the existing FMB name is TEST.fmx then the backup file should be TEST_sysdate.fmx.
    2. Secondly we have to transfer the file from the client folder (or from another folder of the same server) to the server folder where the back up exists.
    Please help me to search/rename/copy/replace the _.fmx/.rdf/.rep/.mmx_ files from client to server.
    We are using
    9i Database.
    10g Forms and reports.
    SQL Developer tool.
    OS is Windows (Client and Server).
    Help me out to attach a file of front end screen which we are planning to develop. It will give a clear picture on this requirement.
    Thanks :)
    Edited by: 941175 on Jun 17, 2012 9:09 AM
    Edited by: 941175 on Jun 17, 2012 9:12 AM
    Edited by: 941175 on Jun 17, 2012 9:14 AM

    941175
    Welcome to the forum. Please take a while to go through the FAQ to be found to the top right of the page.
    Your issue is more to do with batch files rather than Forms. The only relation with Forms, as I see it, is that you will be using HOST/CLIENT_HOST to start a batch file with the file name to be deployed as a parameter passed to it.
    You need to rewrite either a CMD batch file or a Powershell script to achieve what have set out to do.
    For CMD batch files look up http://www.robvanderwoude.com/battech.php , or any of the other excellent resources available on the internet.
    Regards,

  • FLEX 2.0 and Flash Media Server 2.0 Unable to stream from client to server

    Hi All,
    I have been trying to put together a quick demo to stream
    and record audio from Client to Server. I get this error when
    trying to connect to FMS.
    ArgumentError: Error #2126: NetConnection object must be
    connected.
    at flash.net::NetStream/flash.net:NetStream::construct()
    at flash.net::NetStream$iinit()
    at Audio/toggle()
    at Audio/__submit_click()
    my Program fails at this line - ns = new NetStream(nc);
    Your help is greatly appreciated. Here is the MXML file
    Audio.mxml
    This file contains a simple start and stop button start and
    stop audio processing.
    This page is served from Apache Tomcat on host : demoserver1
    and port 8080
    Flash media server is also installed on the same host
    demoserver1.
    I did not do any additional config at FMS except creating an
    application called "DemoApp". All other settings are defaults.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    applicationComplete="startup()">
    <mx:Script>
    <![CDATA[
    import flash.net.NetConnection;
    import flash.net.NetStream;
    public var started:Boolean = false;
    public var nc:NetConnection;
    public var ns:NetStream;
    public var mp:Microphone;
    public function startup():void{
    lblMessage.text="Stopped";
    public function toggle():void{
    if (started==false){
    submit.label="Stop";
    started=true;
    lblMessage.text="Started";
    nc = new NetConnection();
    nc.addEventListener(NetStatusEvent.NET_STATUS,
    netStatusHandler);
    nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    securityErrorHandler);
    nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
    nc.connect("rtmp://demoserver1/DemoApp");
    ns = new NetStream(nc);
    ns.addEventListener(NetStatusEvent.NET_STATUS,
    netStatusHandler);
    mp = Microphone.getMicrophone(0);
    ns.attachAudio(mp);
    ns.publish("sample1", "record");
    else{
    started=false;
    submit.label="Start";
    lblMessage.text="Stopped";
    ns.close();
    nc.close();
    private function netStatusHandler(event:NetStatusEvent):void
    switch (event.info.code) {
    case "NetConnection.Connect.Success":
    trace(" connection success : " );
    break;
    case "NetStream.Play.StreamNotFound":
    trace("Stream not found: " );
    break;
    private function
    securityErrorHandler(event:SecurityErrorEvent):void {
    trace("securityErrorHandler: " + event);
    ]]>
    </mx:Script>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="400"
    height="300">
    <mx:HBox left="19" right="0" height="100" top="30">
    <mx:Label text="Label" id="lblMessage" width="150"/>
    <mx:Button label="Start" click="toggle()" id="submit"/>
    </mx:HBox>
    </mx:Canvas>
    </mx:Application>

    Hi,
    Are you trying to make an air app or a web application (flash) for streaming? You may want to check out the osmf framework to help you write a player for mobile platform. Check out http://www.opensourcemediaframework.com/ for more info on how you can write streaming video players using this framework. There are some good tutorials there and also you may post on the forum to get your specific queries solved.
    Thanks,
    Abhishek

  • APEX 4.0: error while opening a XLS file downloaded from interactive report

    Hi,
    I'm getting below error while opening a XLS file downloaded from an interactive report (APEX 4.0).
    "The file you trying to open, 'customer_2.xls', is in a different format than specified by the file extension.
    Verify that the is not corrupted and is from a trusted source before opening file. Do you want to open file."
    Yes No Help
    May be this one Apex 4.0 issue.
    please help me.
    Thanks
    Mukesh

    Hi,
    is the next part of the code correct.
    What i mean is packing of the attachment, finding out the size of pdf file and doc type as PDF.
    You can also try below link..
    Link: [http://wiki.sdn.sap.com/wiki/display/Snippets/SENDALVGRIDASPDFATTACHMENTTOSAPINBOXUSINGCLASSES]
    Hope this helps.
    Regards,
    -Sandeep

  • How to transfer passwords encrypted from client to server?

    Hello dear community,
    I have already some experience with programming and did a lot of web-software, but I never was facing the problem that passwords are transfered as plain text to the server when using a login-form.
    For my front-end, I use Java ServerFaces 2.0.
    I read a lot of hints like using a javascript based MD5 library and send the password as MD5 but this can be sniffed an decrypted easily.
    Do you have some hints to easily implement a secure transfer of values from client to server?
    best regards,
    Berni

    goose_fraba wrote:
    and how to do that? how to configure etc.?Server specific. Read your server's documentation.

  • Sending an object from client to server always on button press

    What I need is to send an object from client to server but I need to make server wait until another object is sent. What I have is the JFrame where you put the wanted name and surname, then you create a User object with these details and on button press you send this object to the server. I just can't hold the connection because when I send the first object, server doesn't wait for another button click and throws EOFexception. Creating the while loop isn't helpfull as well because it keeps sending the same object again and again. The code is here
    public class ClientFrame extends JFrame {
        private JButton btnSend;
        private JTextField txfName;
        private JTextField txfSurname;
        public ClientFrame() {
            this.setTitle(".. ");
            Container con = this.getContentPane();
            con.setLayout(new BorderLayout());
            txfName = new JTextField("name");
            txfSurname = new JTextField("surname");
            btnSend = new JButton(new AbstractAction() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    SSLSocketFactory f =
                            (SSLSocketFactory) SSLSocketFactory.getDefault();
                    try {
                        SSLSocket c =
                                (SSLSocket) f.createSocket("localhost", 8888);
                        c.startHandshake();
                        OutputStream os = c.getOutputStream();
                        ObjectOutputStream oos = new ObjectOutputStream(os);
                        InputStream is = c.getInputStream();
                        ObjectInputStream ois = new ObjectInputStream(is);
                        boolean done = false;
                        while (!done) {
                            String first = txfName.getText();
                            String last = txfSurname.getText();
                            User u = new User();
                            u.setFirstName(first);
                            u.setLastName(last);
                            oos.reset();
                            oos.writeObject(u);
                            String str = (String) ois.readObject();
                            if (str.equals("rcvdOK")) {
                                System.out.println("received on the server side");
                            } else if (str.equals("ERROR")) {
                                System.out.println("ERROR");
                        //oos.writeObject(confirmString);
                        oos.close();
                        os.close();
                        c.close();
                    } catch (ClassNotFoundException ex) {
                        Logger.getLogger(ClientFrame.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (IOException ex) {
                        System.err.println(ex.toString());
            btnSend.setText("send object");
            con.add(btnSend, BorderLayout.PAGE_START);
            con.add(txfName, BorderLayout.CENTER);
            con.add(txfSurname, BorderLayout.PAGE_END);
            this.pack();
            setSize(200, 150);
            setVisible(true);
    public class TestServer {
        public static void main(String[] args) {
            try {
                KeyStore ks = KeyStore.getInstance("JKS");
                ks.load(new FileInputStream(ksName), ksPass);
                KeyManagerFactory kmf =
                        KeyManagerFactory.getInstance("SunX509");
                kmf.init(ks, ctPass);
                SSLContext sc = SSLContext.getInstance("TLS");
                sc.init(kmf.getKeyManagers(), null, null);
                SSLServerSocketFactory ssf = sc.getServerSocketFactory();
                SSLServerSocket s = (SSLServerSocket) ssf.createServerSocket(8888);
                printServerSocketInfo(s);
                SSLSocket c = (SSLSocket) s.accept();
                InputStream is = c.getInputStream();
                ObjectInputStream ois = new ObjectInputStream(is);
                OutputStream os = c.getOutputStream();
                ObjectOutputStream oos = new ObjectOutputStream(os);
                boolean done = false;
                User u;
                  while(!done){
                    u = (User) ois.readObject();
                    String confirmString = "rcvdOK";
                    String errorString = "ERROR";
                    if (u != null) {
                        System.out.println(u.getFirstName() + " " + u.getLastName());
                        oos.writeObject(confirmString);
                    } else if (u == null) {
                        oos.writeObject(errorString);
                is.close();
                s.close();
                c.close();
            } catch (Exception e) {
                    System.err.println(e.toString());
    }Thanks for any help, btw this doesnt need to be via ssl, the problem would be the same using only http. Please anyone help me:)
    Edited by: Vencicek on 7.5.2012 2:19
    Edited by: EJP on 7/05/2012 19:53
    Edited by: Vencicek on 7.5.2012 3:36

    Current code fails because it's sending still the same entity again(using while loop)No it's not. You are creating a new User object every time around the loop.
    which makes the system freezeWhich means that you are executing network code in the event thread. Don't do that, use a separate thread. At the moment you're doing all that sending inside the constructor for ClientFrame which is an even worse idea: you can never get out of there to the rest of your client program. This is a program design problem, not a networking problem.
    and doesn't allow me to set new parameters of the new entityI do not understand.
    I need to find a way to keep Server running even when the client doesn't send any data and wait until the client doesnt press the send button again to read a new object.That's exactly what happens. readObject() blocks until data is received.

  • Hi- I'm trying to install xcode 2.5. Idon't know what to do w/.exe file downloaded from the apple developer website

    Hi- I'm trying to install xcode 2.5. Idon't know what to do w/.exe file downloaded from the apple developer website.
    I would like to be able to use AU Lab but my developer folder only has extras/palettes inside- no applications or tools.
    Thanks

    Hello,
    What is the full name of this exe file?
    Those are for Windows®

  • Questions regarding jsp file download from blob

    Hi developers, i'm doing jsp file download from a blob column in DB2 using struts,
    1) How do i design the jsp page such that the page will show perhaps a hyperlink for me to download the file?
    2) What about struts-config.xml? Do i need to modify any mappings there?
    It would be great if some kind developers were to provide some sample codes for me. Thanks alot. Your effort is kindly appreciated.

    http://kr.forums.oracle.com/forums/thread.jspa?threadID=1982213 - looks similar, you may need to change contentType as per use case

Maybe you are looking for

  • "No Content" constantly in iPod on iPhone 3G

    My iPhone 3G shows "No Content" when I go to the iPod app, even though it's loaded with music, videos and podcasts. This has been happening to me for the last 6 months or so, and now it's happening all the time. So much so, that I can't use my iPhone

  • Just question

    i'm vodafone gsm customer from egypt using nokia 6630 mobile phone want to connect to internet via my mobile i call a customer service and help me to connect but via gprs (packet data)and during setytin the engneer told me if vpn present on my mobile

  • Digital analog in one queue

    I want to create one queue for both digital and analog data. The attached vi has two. How would you get the 2 different data type feed to one queue? It would require a digital waveform and an analog waveform to get the data into one queue. Any ideas?

  • Broken input and images on website

    After upgrading to Firefox 30.0 from 29.x, some websites no longer work. It seems to be a pervasive issue throughout firefox, and I'm sure if I tried other websites these issues would come up again. But right now, I'm definitely having problems with:

  • Reading config data in a project panel for a jDev 10 Extension

    I have made it past creating config and project setting panels as jdev extension. My question is how can I read the config data when the project panel is displayed? 1) I would like to use the config data as default when the project is first created a