Download files from Pages

HI,
I want to develop an application that downloads a
file from the web page of the same organization that
is updated daily. The page has links and icons
that usually users click to open an excel, csv files
or pdf documents.
I want to download the files, and then read it.
What should i use to download these files and how should
I handle where it downloads etc and i read info from it.
Any help and sample code would be appreciated.
Thnx

Ordinary, not advanced at all, networking code. Here's the tutorial:
http://java.sun.com/docs/books/tutorial/networking/index.html

Similar Messages

  • 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

  • Error in PDF Conversion while downloading file from application server

    Hi,
    I am facing a problem in which i have to download file from application server which is a PDF file (output of SAP Script). I am downloading this file using following code in BSP technology:
    * event handler for data retrieval
    EMPCD = REQUEST->GET_FORM_FIELD( 'emp' ).
    MONTH = REQUEST->GET_FORM_FIELD( 'mn' ).
    YEAR  = REQUEST->GET_FORM_FIELD( 'yr' ).
    W_IND = 'N' .
    DATA : wa_zform16 type  zform16.
    DATA : file_path type string.
    DATA : l_pdf_len type string.
    DATA STR TYPE STRING.
    DATA: OUTPUT    TYPE STRING ,
          L_XSTRING TYPE XSTRING ,
          APP_TYPE  TYPE STRING.
    DATA: PDF_TABLE TYPE  RCL_BAG_TLINE.
    DATA PHY_NAME_OUT     TYPE SAPB-SAPPFAD.
    concatenate '/usr/sap/put/form16/' EMPCD '_' YEAR '.PDF'  into file_path
    *PHY_NAME_OUT = '/usr/sap/put/form16/01000200_2007.PDF'.
    PHY_NAME_OUT = file_path.
    OPEN DATASET PHY_NAME_OUT FOR INPUT IN TEXT MODE ENCODING default.
    IF SY-SUBRC IS INITIAL.
      DO.
        READ DATASET PHY_NAME_OUT INTO STR.
        IF SY-SUBRC IS INITIAL.
          CONCATENATE
              OUTPUT
              STR
              CL_ABAP_CHAR_UTILITIES=>CR_LF
          INTO OUTPUT.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      APP_TYPE = 'APPLICATION/PDF'.
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          TEXT     = OUTPUT
                MIMETYPE = 'APPLICATION/PDF'
    *            MIMETYPE = 'APPLICATION/PDF;charset=utf-16le'
        IMPORTING
          BUFFER   = L_XSTRING.
      CALL METHOD CL_BSP_UTILITY=>DOWNLOAD
        EXPORTING
          OBJECT_S            = L_XSTRING
          CONTENT_TYPE        = APP_TYPE
          CONTENT_DISPOSITION = 'attachment;filename=webforms.pdf'
          RESPONSE            = _M_RESPONSE
          NAVIGATION          = NAVIGATION.
    Result of this code is : there is a pop up asking to open or save pdf format and process is complete, but i have problem in downloaded file.
    At the time of creation i have put BMP image for signature in PDF file and it is working fine but when i upload that file in Application server and then download it with above used code it save the PDF file but when i open that file so whereever i have used signature that page gives error and could not display that scanned signature.
    Can anyone please help me in this regard.
    or is there any possibility from which i can download that file just like File transfer from BSP.
    Keep in mind that i am using BSP technology so all GUI based function module to download file are not working.
    waiting for your reply.....
    Regards,
    Gagan

    Hi Raja,
    I have standard sap form for TDS Certificate on which i have include an BMP image for digital signature and download that script into pdf format.While i download that PDF looks ok but it is not working in BSP.
    Regards,
    Gagan

  • Path and file name problem when I want to download files from html

    Hi all,
    I want to write a small program to allow users download files from jsp file
    but the following files don't work .
    <%@ page language="java" import="java.net.*,java.io.*"%>
    <%@ page import ="java.util.*"%>
    <%
    try
    String SContent = request.getParameter("click");
    String SDocName = "temp.doc"; //  out put file File Name
    ServletOutputStream stream= response.getOutputStream(); // Getting ServletOutputStream
    response.setContentType("application/msword"); // Setting content type
    response.setHeader("Content-disposition","attachment;filename=\"" +SDocName+"\""); // To pop dialog box
    BufferedInputStream in = new BufferedInputStream(new FileInputStream(SContent));
    int c;
    while ((c = in.read()) != -1){
               stream.write(c);
    in.close();
    stream.flush();
    catch(final IOException e)
    System.out.println ( "IOException." );
    catch(Exception e1)
    System.out.println ( "Exception." );
    %>I am so confuse, what is the path and file name I sould give ? for example my click should equal to http://******/Test/display.jsp?click=00-1

    Hi all,
    I got error at
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
         org.apache.coyote.tomcat5.CoyoteResponse.getWriter(CoyoteResponse.java:599)
    if I want ot download file from html file.
    String SContent = request.getParameter("click");
    if I hard code like follow it work fine.
    String SContent ="C:/Project Coding.doc";
    what mistake I make.
    Thank you!

  • Downloading file from application server to presentation server

    Hi,
          We have a requirment to download file from application server to presentation server.  The problem is while down loading, some of the filds showing some junk values. Instead of that junk values we have some Russian texts there.  These Russian texts only coming as junk all other data is correct.  The file in the appplication server is in .dbf format. We are downloading using WS_DOWNLOAD. file type is BIN and code page we didn't specified.
    Thanks in Advance
    Jijeesh.P.G
    Message was edited by: Jijeesh.P.G
            Jijeesh P G

    hi jijeesh,
       Welcome to SDN.
    u can use to download file from application server to presentation server using the t/c CG3Y. in that it will ask the source file path and the target file path.
    if u want to find the source file path in the application server, u can use the transaction AL11 to find that one.
    Regards....
    Arun.
    Reward points if useful.

  • Downloading files from DVD or hard drive cameras

    Is it possible to download files from hard drive or dvd cameras to be used in Premiere without using the capture function which needs to be done in real time?

    Importing files from a DVD camcorder or other MPEG device, or Ripping DVD files rarely results in success in Premiere... do not be fooled by movie industry advertising into thinking that "DVD Quality Video" is suitable for EDITING... it is not... a DVD is designed to be for PLAYBACK only... and that includes trying to edit a Standard Def MPEG file!
    Go to my notes page http://www.pacifier.com/~jtsmith/ADOBE.HTM
    Click the internal link for editing compressed files... read
    There are other products better suited to your task... but if you only have DVD type files, you should convert to DV AVI
    The only SD files that Premiere likes are DV AVI type 2

  • Where can i get an example of Viewing wap, downloading files from wap site?

    as we know, almost every simulator has this function. now i wanna write the same function via MIDP, how?
    And, anyone know nextel i730, it's very weird that it cannot download file from the wap site but other phones can do it from the same site.
    any help would be appreciated.

    WAP = HTTP. Just open a http page in midp and read the data. Displaying WAP in MIDP is another thing, since it does not have facilities for that. Why should it anyway? All phones that hava java, already have a W(AP/EB) browser.

  • Can t download files from internet to my Ally

    i ve had my Ally less than week.......when i try to download files from internet i get error msg that download failed.....i tried to click link and hold link and choose save and still download fails........help me.......please

    Try to Clear your Temporary Internet Files and Cookies. To delete your temporary internet files on the Lg Ally follow the directions below:
    From the Home screen, touch the applications tab (bottom of the screen).
     Touch Browser.
    Press the Menu key.
    Touch More
    Touch Settings.
    Touch Clear cache.
    Some visited website content stored on the device. The cache enables the browser to download only the content that has changed since the last time a website was visited. Since the browser only downloads changed content, pages are loaded faster.
    Touch OK.
    Touch Clear history.
    A listing of URLs (website addresses) that have been recently visited.
    Touch OK.
    Touch Clear all cookie data.
    Some visited website content stored on the device. The cache enables the browser to download only the content that has changed since the last time a website was visited. Since the browser only downloads changed content, pages are loaded faster.
    Touch OK.
    You can also find this information on the Verizon Wireless website HERE
    Hope this helps!

  • Seeks algorithms for downloading file from WWW

    I have a big question for how many different ways for me to download file from WWW.
    Can someone list those methods and the "Java offical" classes/libraries that needed?
    Also which is the BEST and most EFFICIENCY?
    Here are some methods:
    1a. Download from html [bytes by bytes]
    - Create a connection to the url (use Url)
    - While not EOF
    - Read the file (use BufferedReader)
    - Write to another file (use BufferedWriter)
    - Close all connection
    1b. Download from html [line by line]
    - Create a connection to the url (use Url)
    - While not EOF
    - Read the file line by line (use BufferedReader)
    - Write to another file (use FileWriter)
    - Close all connection
    Can someone tell me which class I can use to monitor the connection? (i.e. the file size, connection speed, time required, size downloaded, etc)
    Can someone tell me how I can compress the data before downloading it from the web just like those download managers?
    Can someone tell me how I can divide the file as those download managers do?
    Thx

    I have a big question for how many different ways for
    me to download file from WWW.
    Can someone list those methods and the "Java offical"
    classes/libraries that needed? Most of your questions are answered in the Custom Networking tutorial, in particular this page here:
    http://java.sun.com/docs/books/tutorial/networking/urls/readingURL.html
    Also which is the BEST and most EFFICIENCY?It depends on a lot of things, particularly on the speed of your network connection.
    Can someone tell me which class I can use to monitor
    the connection? (i.e. the file size, connection speed,
    time required, size downloaded, etc)There's a tutorial about input and output there too.
    Can someone tell me how I can compress the data before
    downloading it from the web just like those download
    managers?You can't do anything to the file before it gets to your side of the connection. You must be mistaken about the capabilities of those download managers.
    Can someone tell me how I can divide the file as those
    download managers do?Not me.

  • Cannot download files from certain websites: log-in prompt

    Hi, I am for some reason getting a log-in prompt when clicking on downloadable files from certain websites (pdf files, etc.). It is especially strange because it is happening on multiple sites, which gave me no problem downloading in the past. This is particular to my computer, and it is happening in different locations, so it can't be a problem with my isp or something.
    I am getting this prompt:
    "To view this page, you need to log in to area "PAGE TITLE" on "www.address.com:80"
    Your password will be sent in the clear."
    (Where PAGE TITLE and address.com are specific to the page I'm trying to access)
    I've tried giving a username and password, but it didn't work. I tried emptying my cache and deleting cookies, renewing my ip address, to no avail. I do not use any proxies, so I am really confused now.
    I've found no documentation of anyone else having this issue.
    Any help would be appreciated!

    i figured it out... it was just a strange coincidence, nothing wrong after all.

  • Why can't I download file from any websites?

    Whenever I try to download files from filesharing sites like mediafire, I click the download button and the page appears to be loading and nothing happens.
    After several tries, I found out that while the page is loading, it is actually downloading the file because the time it takes for the page to load before the "open" or "save file" windows come out depends on the size of the file. And immediately after I click "save file" the download is done, and I can open whatever I downloaded. The time ranges between 5min to 30min depending on the file size.
    Usually the "save file" window will display immediately when I click on the download button, the the fire fox download window will show the progress of the download and % of completion. But no, for me nothing appears in the download window, and I don't get to see the progress of my download until it is apparently "completed" after the webpage finished loading.
    I have tried every solution that I know, cleaning my browser history and cookies, resetting firefox, clearing up my computer's registry, even did a clean reinstall of firefox, wiping everything including my bookmarks, but none of these solves the problem. I am also pretty sure that my firefox extension are not the ones to blame as I did do a test download after a clean reinstall, which did not work as well.

    My problem is fixed after I set the firefox connection settings from "use system proxy setting" to "no proxy". After setting to no proxy, the downloads happens as it should.
    but my question now is what is system proxy? and what is the difference between using these 2 different options?

  • Errors when downloading files from web sites

    I cannot download files from Firefox anymore on my home computer. I click on the download link and it takes me to another page that is blank. I can download just fine w/o any problems from my work computer, download box/window appears just fine. I'm using the same Windows 7, Firefox 8.0 program and same website that gives me the error message from my home computer. Is there a pop-up blocker, cookie or plug-in that I need to turn off/on? How do I enable downloads so I can save to my home computer?

    Clear cache and cookies and try again. Also, check your firewall permissions for Firefox 8

  • About "Upload and download files from ADF into blob type colum."

    hi
    Using JDeveloper 10.1.3.3.0 I have tried the example available for download from this blog post by Jakub Pawlowski:
    "Upload and download files from ADF into blob type colum."
    at http://kuba.zilp.pl/?id=1
    First a thank you to Jakub for this interesting example.
    I have a question about a PDF file that I uploaded using the example.
    The file has a size of 10445518 bytes.
    After I upload that file, the blob column has a value with a size of 10445516 bytes, 2 bytes less.
    SQL> select file_name, dbms_lob.getlength(stored_file) from blob_table;
    FILE_NAME
    DBMS_LOB.GETLENGTH(STORED_FILE)
    ADF-DeveloperGuide-4GL-B25947_01.pdf
                           10445516If I download that file using the example, it has the same size as the blob value, 10445516 bytes.
    If I open the downloaded file, using Adobe Reader 8.1.1, it first shows this message:
    "The file is damaged but is being repaired."
    After that, there is not problem using the PDF file in Adobe Reader.
    I have tried this with both Internet Explorer 6 and Firefox 2.0.0.11.
    I have also tried this with other (smaller) files, and those upload and download correctly.
    question:
    Why are those 2 bytes lost during upload?
    many thanks
    Jan Vervecken

    Hi!
    I can only post you my code that works for me and as I said I had same problems but can't remember what solved them. My code:
      public void fileUploaded(ValueChangeEvent event)
        FacesContext fc = FacesContext.getCurrentInstance();
        UploadedFile file = (UploadedFile) event.getNewValue();
        if (file != null && file.getLength() > 0)
          // here I have some messages written and a call to the method on AM to save the uploaded file to the DB
      private BlobDomain newBlobDomainForInputStream(InputStream in)
        throws SQLException, IOException
        BlobDomain loBlob = new BlobDomain();
        OutputStream out = loBlob.getBinaryOutputStream();
        writeInputStreamToWriter(in, out);
        in.close();
        out.close();
        return loBlob;
      private static void writeInputStreamToWriter(InputStream in,
                                                   OutputStream out)
        throws IOException
        byte[] buffer = new byte[8192];
        int charsRead = 0;
        while ((charsRead = in.read(buffer, 0, 8192)) != -1)
          out.write(buffer, 0, charsRead);
       * Launch the upload - see fileUploaded() for actual upload handling.
       * @return null navigation event - we stay on this page
      public String UploadButton_action()
        if (this.getMyInputFile().getValue() == null)
          FacesContext context = FacesContext.getCurrentInstance();
          FacesMessage message =
            new FacesMessage(FacesMessage.SEVERITY_WARN, JSFUtils.getStringFromBundle("fileupload.emptyfielderror"),
                             null);
          context.addMessage(this.getMyInputFile().getId(), message);
        return null;
       * Setter for inputFile UI Component.
       * @param inputFile inputFile UI component
      public void setMyInputFile(CoreInputFile inputFile)
        this.myInputFile = inputFile;
       * Getter for inputFile UI Component.
       * @return inputFile UI component
      public CoreInputFile getMyInputFile()
        return myInputFile;
      }fileUploaded is a valueChangeListener on inputFile and UploadButton_action is as the name says the action for upload button.
    Hope this helps. If not, than your problem is probably not the same as mine was, although the message about file corrupted was the same.
    Next thing you can check in this case is if your file exceeds max file upload size. I don't know the exact default value, but if the file is too long I think this upload logic will upload only a part of the file and save it to the DB which can also lead to the same file corrupted error.
    You can set the max upload value in web.xml like this:
    <context-param>
    <!-- Maximum memory per request (in bytes) -->
    <param-name>oracle.adf.view.faces.UPLOAD_MAX_MEMORY</param-name>
    <!-- Use 5000K -->
    <param-value>5120000</param-value>
    </context-param>
    <context-param>
    <!-- Maximum disk space per request (in bytes) -->
    <param-name>oracle.adf.view.faces.UPLOAD_MAX_DISK_SPACE</param-name>
    <!-- Use 10,000K -->
    <param-value>15360000</param-value>
    </context-param>

  • Download file from the web

    Hey,
    I'm struggling to download files from the web.
    The first approach I though of was simply opening the url in Safari, but it would just open the file, not download it.
    Then there is an application called "URL Access Scripting", but I can't figure out how it works.
    That might sound stupid, since it has only a download and an upload command, but they do not work.
    The download function asks for a file specification, what the #$^& is that?
    I tried supplying a file, but to no avail.
    For obvious reasons I can't make an alias of a not yet existing file, so what do I put in there?
    It seems file specification is a deprecated format.
    My last resort was running curl in a shell script, which works, but that feels hackish.
    Is there any good way to do this?

    Hi pepsel,
    Let's take an example. Suppose that you want to download “UltiCalc Mac 2.5” (freeware) from [this Web page|http://www.apple.com/downloads/macosx/games/utilities/ulticalcmac.html]. You can proceed as follows:
    --BEGINNING OF SCRIPT
    set theURL to "http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=23023&cat=25&platf orm=osx&method=sa/ulticalc_mac.zip"
    set theFile to "/Users/pierre/Desktop/My_download.zip" -- same extension as the file to download
    tell application "URL Access Scripting" to download theURL to theFile
    --END OF SCRIPT
    Of course, you should replace “pierre” with the name of your own home folder.
    Hope it can help.
    Message was edited by: Pierre L.

  • [HELP] Download file from FTP server

    hi,
    I want to write a java program that can download and upload files from ftp server. Currently I only manage to upload a file to ftp server but i cant download file from ftp server. Here is the source code that only allow user to upload file. Anyone can give me some guidelines so that my program can download and also upload file? thx.
    import java.io.*;
    import java.net.*;
    public class FTPUpload {
    private static final int CTRLPORT = 21;
    private static Socket ctrlSocket;
    private static PrintWriter ctrlOutput;
    private static BufferedReader ctrlInput;
    private static byte[] localHostAddress;
    public final static String DIR = "C:\\zip\\";
    public static void main(String[] args) {
    try {
    String host = "192.168.1.1";
    String loginName = "testuser";
    String password = "password";
    String dirName = "/home/testuser";
    String fileName = "hello.zip";
    ctrlSocket = new Socket(host, CTRLPORT);
    localHostAddress = ctrlSocket.getLocalAddress().getAddress();
    ctrlOutput = new PrintWriter(ctrlSocket.getOutputStream());
    ctrlInput = new BufferedReader(new InputStreamReader(ctrlSocket.getInputStream()));
    ctrlOutput.println("USER " + loginName);
    ctrlOutput.flush();
    ctrlOutput.println("PASS " + password);
    ctrlOutput.flush();
    ctrlOutput.println("CWD " + dirName);
    ctrlOutput.flush();
    ctrlOutput.println("TYPE I");
    ctrlOutput.flush();
    FileInputStream fis = new FileInputStream(DIR + fileName);
    Socket dataSocket = dataConnection("STOR " + fileName);
    OutputStream outstr = dataSocket.getOutputStream();
    int n;
    byte[] buff = new byte[1024];
    while ((n = fis.read(buff)) > 0) {
    outstr.write(buff,0,n);
    dataSocket.close();
    fis.close();
    ctrlOutput.close();
    ctrlInput.close();
    ctrlSocket.close();
    }catch (Exception e) {
    e.printStackTrace();
    private static Socket dataConnection(String ctrlcmd)
    throws IOException,UnknownHostException {
    String cmd = "PORT ";
    ServerSocket serverDataSocket = new ServerSocket(0,1);
    for (int i=0;i<4;i++) {
    cmd = cmd + (localHostAddress[i] & 0xff) + ",";
    cmd = cmd + (((serverDataSocket.getLocalPort())/256) & 0xff)
    + ","
    + (serverDataSocket.getLocalPort() & 0xff);
    ctrlOutput.println(cmd);
    ctrlOutput.flush();
    ctrlOutput.println(ctrlcmd);
    ctrlOutput.flush();
    Socket dataSocket = serverDataSocket.accept();
    serverDataSocket.close();
    return dataSocket;
    }

    Or just use a java.net.URL("ftp://...) ..., get its input stream, and away you go ...

Maybe you are looking for

  • Is there a way to have a shared photostream where multiple people can upload?

    In our buiness we take many photos for our boss to see, my coworkers and I have iphones and we all take pictures and instead of emailing the photos to our boss it would be nice if we could have one central photosteam for my coworkers, me and our boss

  • Remote Restart of Services (with dependencies)

    Hello all, i've a short question about restarting a service on a remote machine with powerhell. I've tried the following: get-service -computername ServerXY -name ServiceXY | Set-Service -Status stopped And it works like a charm. But some services ha

  • Problems postscript: vector graphics to FlexRip

    Hi guys, I have a very serious problem in my company often happens that generating a postcript with illustrator and passing through the dispatcher FlexRip Vers 12 (Esko), cause problems on the edges of the letters, vector graphics or parts of graphic

  • How to fade in songs

    How can you fade in songs, when going from one song to another?

  • Import customs code list I0136 - how to get .xml file

    The code list I0136 from ATLAS is in format .tsv. It's possible to import the code list in transaction /SAPSLL/CUSCS_VMAINT, but you have to have a .xml file. Does anyone know where to get the customs code list I0136 in .xml or to convert .tsv into .