Get File with HTTP

Hello.
I am trying to get a file that is in a web server using HTTP protocol. The server is IIS and needs authentication, also, the url i give will redirect me to the url of the file i need to download.
How can this be done?
Thank you
Nuno Silva

I'm trying the following code:
  url = 'http://192.168.0.1/image.bmp'.
  CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
    EXPORTING
      URL                = url
    IMPORTING
      CLIENT             = http_client
    EXCEPTIONS
      ARGUMENT_NOT_FOUND = 1
      PLUGIN_NOT_ACTIVE  = 2
      INTERNAL_ERROR     = 3
      others             = 4.
  IF SY-SUBRC = 0.
    http_client->send( ).
    http_client->receive( ).
    content = http_client->response->get_cdata( ).
    http_client->close( ).
  ENDIF.
When i try this i get a popup asking me for the username and password. I put the correct password and it wont work. After the third try it will just fail.
Any idea why does this fail?
Thank you
Nuno Silva

Similar Messages

  • Spotlight/Finder can't find a file, yet when I search the timecapsule for they find it. If I try to restore the file I get "file with that name already exists...." What is wrong?

    I was trying to find a file (iTunes Backup). When using finder/Spotlight they couldn't find the file.
    I then opened up my timecapsule and searched for the file....tick-a-de-da it found it in yesterdays backup. I attempted to restore the file and got the prompt "A file with that name already exists in this location, would you like to keep both, replace the file or cancel the request.
    So if the file is there why can't spotlight/finder find the file??
    If it helps I get this from the terminal when checking if indexing was enabled.
    $ mdutil -s -a
      Indexing enabled.
    /Volumes/Data:
    2014-11-18 18:09:39.542 mdutil[1472:572531] Metadata.framework [Error]: mdsCopyStoreAttributes failed: (8) (os/kern) no access
      No index.
    /Volumes/Time Machine Backups:
      Indexing and searching disabled.
    /Volumes/Time Machine Backups/Backups.backupdb:
      Indexing enabled.

    Hi Danielle,
    Is there any possibilty that some of your files (a VI or DLL?) have been moved, renamed, or deleted? Also, what version of LabVIEW are you using and are you using any .NET DLLs? Another option to consider would involve VISA or DAQmx property nodes. Are you using any of these property nodes in your code? Here is a KnowledgeBase article to describe more about the VISA and DAQmx property nodes in a source distribution:
    Error Creating Source Distributions Involving rc Files: http://digital.ni.com/public.nsf/allkb/833BFD5E9CA0224886257584004DAA4C?OpenDocument
    I hope this is able to help.
    Anna L
    Applications Engineer
    National Instruments

  • Get file from HTTP POST (upload image)

    Hello,
    I would like to integrate http://www.plupload.com flash component to my APEX 4.1 website. I need it because I want to resize image and transform image before upload on client side, upload multiple files etc..
    But I don't know how to read image binary data from POST method.
    When I hit "Start upload" button on plupload component it makes some transformations and creates POST method like this:
    ------pluploadboundary1334433145869
    Content-Disposition: form-data; name="name"
    p16qp6jm3nhan1ca46me1ocr3tu1.jpg
    ------pluploadboundary1334433145869
    Content-Disposition: form-data; name="chunks"
    1
    ------pluploadboundary1334433145869
    Content-Disposition: form-data; name="chunk" 0
    ------pluploadboundary1334433145869
    Content-Disposition: form-data; name="file"; filename="centerd.jpg"
    Content-Type: image/jpeg
    ÿØÿà�JFIF������ÿÛ�„�
    image content
       now I would like to read content of this HTTP POST and read sended image and store it to DB.
    Question is... how can I read file sended with HTTP POST in APEX pl/sql process or pl/sql procedure?
    Thank you...
    Edited by: cardel on Apr 14, 2012 11:17 PM

    Hi,
    here are my two cents ...
    this will be a bit difficult. When you use the standard APEX File upload it is not PL/SQL handling the POST request. The request is handled by the webserver - depending on the variant you are using it is either mod_plsql, the C code of the Embedded Gateway or the APEX Listener. The webserver is also doint the insert into APEX' file repository. So I see two options:
    It might be possible to configure your plugin (don't know about it) the behave the same as a standard browser upload. Then for APEX there would be no difference - mod_plsql should handle the files accordingly.
    If you want to handle the POST request yourself, as said, you can't do this in PL/SQL. It would be possible to write a Java servlet doing this and deploy that servlet on the same container as the APEX Listener (when using Apache with mod_plsql you would need an additional Java server for that) ....
    Hope this helps ...
    Best regards
    -Carsten

  • How to upload large file with http via post

    Hi guys,
    Does anybody know how to upload large file (>100 MB) use applet to servlet with http via post method? Thanks in advance.
    Regards,
    Mark.

    Hi SuckRatE
    Thanks for your reply. Could you give me some client side code to upload a large file. I use URL to connect to server. It throws out of memory exception. The part of client code is below:
    // connect to the servlet
    URL theServlet = new URL(servletLocation);
    URLConnection servletConnection = theServlet.openConnection();
    // inform the connection that we will send output and accept input
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true);
    // Don't used a cached version of URL connection.
    servletConnection.setUseCaches (false);
    servletConnection.setDefaultUseCaches(false);
    // Specify the content type that we will send text data
    servletConnection.setRequestProperty("Content-Type",
    +"application/octet-stream");
    // send the user string to the servlet.
    OutputStream outStream = servletConnection.getOutputStream();
    FileInputStream filein = new FileInputStream(largeFile);
    //BufferedReader in = new BufferedReader(new InputStreamReader
    +(servletConnection.getInputStream()));
    //System.out.println("tempCurrent = "+in.readLine());
    byte abyte[] = new byte[2048];
    int cnt = 0;
    while((cnt = filein.read(abyte)) > 0)
    outStream.write(abyte, 0, cnt);
    filein.close();
    outStream.flush();
    outStream.close();
    Regards,
    Mark.

  • How to get files with no checked in version from library that has exceeded the threshold limit

    I have exceeded the threshold limit for library, when I click on "Manage files which have no checked in version"
    I get error that threshold limit has been exceeded for library, so I am not able to use this option.
    Please let me know if there is any workaround or script that can be used to get this done.
    or if we can modify the view with some query

    Hi niles, Here is a page that details how to retrieve all the files and take ownership of them via powershell to check them in:
    http://www.demantprasad.com/2013/05/manage-files-which-have-no-checked-in.html
    Mathieu Desmarais http://www.matdesmarais.com/

  • Accessing a .exe file with HTTP Request

    Hi!
    Can I access an executable file located in a WEB page with JMeter?
    I'm tryng to use a HTTP Request:
    Server Name or IP: 111.111.111.1
    Port Number: 8080
    Path: /cliente/file.exe
    The file is in a Tomcat application.
    When I run, in the View Results Tree - Sampler Result, it shows:
    Load time: 63
    HTTP response code: 400
    HTTP response message: Bad Request
    HTTP response headers:
    HTTP/1.1 400 Bad Request
    Date: Wed, 27 Apr 2005 14:26:09 GMT
    Server: Apache-Coyote/1.1
    Connection: close
    I already had copied the link and placed it into the browser to verify
    if it was correct and i had access to the file normaly.
    What am I doing wrong?
    Thanks in advance.
    Marcelo.

    If the .exe file is publically-accessible from your web server (like other normal .html files are for example), then accessing that resource would be done the same way as accessing others (get a stream of bytes that the server would serve up, and do something with those bytes on the client end of the connection). I don't know what JMeter has to do with that.

  • Robohelp 7 HTML cannot get files with accented characters in the name

    The files are added without a problem but "Get" operation
    returns error "invalid file name"
    Example of the file name Le_système.htm or
    Aperçu_du_système.htm

    I got a similar response when RSC didn't like some of the
    special characters (punctuation) that sneaked into some of our
    files. Your other files operate normally, right? I'd report this to
    Adobe as a bug.
    G

  • Problem to get file with special characters in the message

    Hi, I'm developing an application that read the email and save the attached file. However, some files have special characters in the name, like: Documento de EspecificaÇÂO.doc
    I noticed the de name of the file in de message head is:
    "=?iso-8859-1?Q?Documento_de_Especifica=E7=E3o.doc?="
    I'm already using the JavaMil 1.4.5
    Tha is my code:
    package br.com.cesan.helpdesk;
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Properties;
    import javax.mail.Flags;
    import javax.mail.Folder;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Part;
    import javax.mail.Session;
    import javax.mail.Store;
    import javax.mail.search.FlagTerm;
    public class LerEmail2 {
         * @param args
         * @throws MessagingException
         * @throws IOException
         public static void main(String[] args) throws MessagingException, IOException {
              // TODO Auto-generated method stub
              // Get session
         Session session = Session.getInstance(new Properties(), null);
         // Get the store
         Store store = session.getStore("pop3");
         store.connect("pop.xxxxx.com.br", "user", "password");
         Folder folder = store.getFolder("INBOX");
              //folder.open(Folder.READ_ONLY);
              folder.open(Folder.READ_WRITE);
              // Show only unreaded Messages
              FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
              // Get directory
         Message message[] = folder.getMessages();     
         //Message messages[] = folder.search(ft);
         for (int i=0, n=message.length; i<n; i++) {
              System.out.println(i + " - "+ message.getSubject() +" - " + message[i].getSentDate() );
              Object content = message[i].getContent();
              if (content instanceof Multipart) {
         handleMultipart((Multipart)content);
         } else {
         handlePart(message[i]);
         // Close connection
         folder.close(false);
         store.close();
         public static void handleMultipart(Multipart multipart) throws MessagingException, IOException {
              for (int i=0, n=multipart.getCount(); i<n; i++) {
                   handlePart(multipart.getBodyPart(i));
         public static void handlePart(Part part) throws MessagingException, IOException {
              String disposition = part.getDisposition();
         String contentType = part.getContentType();
         if (disposition == null) { // When just body
              System.out.println("Null: " + contentType);
              // Check if plain
              if ((contentType.length() >= 10) && (contentType.toLowerCase().substring(0, 10).equals("text/plain"))) {
                   part.writeTo(System.out);
              } else { // Don't think this will happen
                   System.out.println("Other body: " + contentType);
                   part.writeTo(System.out);
         } else if (disposition.equalsIgnoreCase(Part.ATTACHMENT)) {
              System.out.println("Attachment: " + part.getFileName() + " : " + contentType);
              saveFile(part.getFileName(), part.getInputStream());
         } else if (disposition.equalsIgnoreCase(Part.INLINE)) {
         System.out.println("Inline: " +
         part.getFileName() +
         " : " + contentType);
         saveFile(part.getFileName(), part.getInputStream());
         } else {  // Should never happen
         System.out.println("Other: " + disposition);
         public static void saveFile(String filename, InputStream input) throws IOException {
              if (filename == null) {
                   filename = File.createTempFile("xx", ".out").getName();
              // Do no overwrite existing file
              File file = new File(filename);
              for (int i=0; file.exists(); i++) {
                   file = new File(filename+i);
              System.setProperty("file.encoding", "iso-8859-1");
              FileOutputStream fos = new FileOutputStream(file);
              BufferedOutputStream bos = new BufferedOutputStream(fos);
              BufferedInputStream bis = new BufferedInputStream(input);
              int aByte;
              while ((aByte = bis.read()) != -1) {
                   bos.write(aByte);
              bos.flush();
              bos.close();
              bis.close();
    The problem occurs in:
    FileOutputStream fos = new FileOutputStream(file);
    BufferedOutputStream bos = new BufferedOutputStream(fos);
    BufferedInputStream bis = new BufferedInputStream(input);
    int aByte;
    while ((aByte = bis.read()) != -1) {
    bos.write(aByte);
    Thanks
    Edited by: user10283976 on 30/03/2012 07:36
    Edited by: user10283976 on 30/03/2012 07:37
    Edited by: user10283976 on 30/03/2012 07:37
    Edited by: user10283976 on 30/03/2012 07:38
    Edited by: user10283976 on 30/03/2012 07:40
    Edited by: user10283976 on 30/03/2012 07:41
    Edited by: user10283976 on 30/03/2012 07:42

    http://www.oracle.com/technetwork/java/javamail/faq/index.html#encodefilename

  • Ftp get file with original date and time on one server to another server

    Dear All,
    I have successfully file copied from ftp server1 to ftp server2 but i cant get original file date and time.If anyone knows please help me...
    i have using the package is sun.net.ftp.FtpClient .
    Thanks
    Andavar.P

    Use the Apache commons-net library which has an excellent and easy to use FTP API, properly documented too.

  • Getting Files with batch by batch From Hard Disk

    hi,
    I have lakhs of xml files in my hard disk, and there is no specific pattern in the file name, I have to load the xml files in iteration by iteration. For each iteration i have to load 200 files, is there is any way to do with DirectoryInfo.GetFiles() ?
    with regards
    Ahamed.

    Hi,
    This not possible with DirectoryInfo.GetFiles(), you can do your own custom solution by filling the
    whole file name into a string array and then loop over by using ArraySegment, see below:
    int count = 10;//hop size
                int offset =0;
                int segmentsize = 10;
                bool stop = false;
                string[] filePaths = Directory.GetFiles(@"yourpath", "*.xml", SearchOption.TopDirectoryOnly);
                do
                    if ((offset + count) > filePaths.Length)//Validate that you not running over the array index
                        count = filePaths.Length - offset;
                        stop = true;
                    var segment = new ArraySegment<string>(filePaths, offset, count);
                    for (int i = segment.Offset; i <= segment.Count + segment.Offset - 1; i++)
                        Console.WriteLine(segment.Array[i]);//Do your work here over the files
                    offset = offset + segmentsize;//increment the offset to read the next segment size,
                } while (stop == false);
    Fouad Roumieh

  • Getting Started with HTTPS

    Hi,
    I have been writting lan based web apps for 4 years and have never needed to use SSL. The need has arisen, but to be honest I am unsure what steps need to be taken to implement it.
    What I want to do for starters is to just create a simple web app that takes in a username and password and then submits the params using HTTPS.
    Any help or web links greatly welcomed.
    Thanks
    Justin

    u read u r app server or webserver docs ,How to set up ssl
    if u want java client example
    http://javaalmanac.com/egs/javax.net.ssl/Server.html
    i think this will help u
    Anand

  • Files with .a extension using ftp transport

    Hi.
    Am using ftp adapter in osb to read .txt files(e.g. abcd.txt) from ftp location, process the body/text() in OSB and then place the incoming file to an outbound folder.
    the flow is like ftp-> Proxy Service->Business Service->outbound ftp
    the service works fine where then is less load or the no. of incoming files is less.
    However,sometimes the outbound folder contains the files with .a extension at the end.(e.g. abcd.txt.a)
    Can someone tell me the rootcause of these .a file creation and the scenarios in which the .a files are created.
    Also,please tell me what are these .a files meant for?
    How,can I eliminate this while configuring the services using ftp transport.
    Thanks in adavance

    I had this recently with a variety of FTP servers, FileZilla, Microsoft etc.
    For me, it happened when the file already exists in the destination and I was expecting the destination file to be overwritten. My application would generate the same filename, say FileA.txt and expect that to be overwritten, but with OSB 10gR3 I would get files with .a stuck on the end.
    This functionality changed between ALSB and OSB and I had a patch developed to restore the ALSB functionality.
    I spent ages looking at it, and debugging FTP commands and going from memory, I'm pretty certain that the FTP adapter doesn't implement the correct FTP spec for the RNFR command according to the RFC in the case where a file already exists - it doesn't handle overwrite.
    Hope that may help.
    Pete

  • Some encoded files with subtitle and other are not

    I just encoded a few videos files with Nokia Video Manager. and all files b4 encoding are with subtitles(*.smi) in one same folder. I played encoded files and some results are with subtitles. (I didn't set up the video manager program to inserted the subtitles into final encoded files. also there is no option I can make insert subtitles in). and rest of files are not with subtitles. now I wanna make all files with subtitles. how make all files with subtitles?

    Short answer is I don't know.
    The way I get files with Subtitles is by Ripping the DVD with ImTOO DVD ripper, in the selections I select the audio track and Subtitle from the DVD to be used during the encoding. Then the resulting video has the subtitles built in.
    I can't get Nokia Video Manager to work reliably for me so I don't use it.
    640K Should be enough for everybody
    El_Loco Nokia Video Blog

  • Problem with https

    I used Firefox for a long time with no problems. I never played with the internal settings (from about:config). One day, with version 21, I found out that every time I do a image search in Google, I could see only 15 to 20 pics correctly and all the others appeared as grey boxes. I deleted cookies and cache but nothing changed. I tried to find a solution and in a Mozilla’s forum was said to reset Firefox from “Troubleshooting Information” menu. I did it and the problem disappeared. Then, another, worse problem, appeared. All sites were tried to get opened with https in front and in all cases Firefox was telling me that the connection is untrusted and can’t confirm that my connection is secure. I was selecting “I understand the risks” and the site was appeared but it was altered, it hadn’t the look that it should have. I did a google search to find a solution. Nothing really helpful came up. In your forum I found a setting, “browser.urlbar.autoFill” that should be turned to false. I did it and the problem was fixed is some pages. Now I can open google and some other pages with no problem but some others, like yahoo mail, that require secure connection (https) cannot get accessed. I tried to uninstall Firefox using Revo Uninstaller, to be sure that all data will be deleted. I reinstalled Firefox but the problem still exists. I uninstalled Firefox again and downloaded and installed version 22 beta 3 of Firefox with the same luck. So, what’s wrong? What should I do?

    Check out why the site is untrusted (click "Technical Details to expand that section) and if this is caused by a missing intermediate certificate then see if you can install this intermediate certificate from another source.
    You can retrieve the certificate and check details like who issued certificates and expiration dates of certificates.
    *Click the link at the bottom of the error page: "I Understand the Risks"
    Let Firefox retrieve the certificate: "Add Exception" -> "Get Certificate".
    *Click the "View..." button and inspect the certificate and check who is the issuer.
    You can see more Details like intermediate certificates that are used in the Details pane.
    If "I Understand the Risks" is missing then this page may be opened in an (i)frame and in that case try the right-click context menu and use "This Frame: Open Frame in New Tab".
    Some firewalls monitor secure (https) connections and send their own certificate instead of the website's certificate.
    *ESET setup -> advanced setup -> extend web and email tree -> SSL
    *SSL protocol: Do not scan SSL protocol

  • How to send multiple files with it's original name over HTTPS using one CC?

    I am working on a File to HTTPs scenario. It is in production and working fine. Currently we send only one file and I have hard coded the name in the communication channel in the header fields. Now we have to send more files with different names and I want to use only one receiver channel instead of many. We need to send the files with their original names.
    I used the ASMA in the sender File Adapter and I see the FileName in the dynamic configuration under http://sap.com/xi/XI/System/File name="FileName".
    I know we can use a UDF in message mapping and get the value and put it in HEADERFIELDONE. But we don't want to use mapping as the files are huge and we don't want to insert XML tags in the payload.
    So how do I put the Filename from the DynamicConfiguration to the HTTP header field as FileName without using mapping? Are there any settings?
    Can I put something in the PROLOG or can I use any other module in the File Sender Adapter or is there any other option?
    Any help is appreciated.
    Thanks
    Sai

    See my blog:
    /people/stefan.grube/blog/2009/06/19/unknown-use-case-of-dynamicconfigurationbean-store-file-name-to-jms-header-without-mapping
    You have to put the configuration in sender channel, as HTTP adapter does not allow modules.
    For the second module, put values related to HTTP adapter.

Maybe you are looking for

  • External Monitor Issues

    Whenever I connect my external monitor (Dell 1600x12000) My laptop gets really slow and my internet connection plummets, please help!!

  • Is it possible to change the name of a computer in itunes? And if so, how?

    I got a new computer and am giving the old one to my sister... but on our home sharing network it shows as the name I had for it. So basically if my device (computer) is called pizza... how do I get it named hotdog? I was able to change all other dev

  • Split InternalFrames in a JFrame

    Hi, everybody, I want to place some internal frames in a JFrame, those internal frames can be iconified, maximizable,resizable and closable, and the most important, they can be splited in a JFrame, just like JSplitpane in a JFrame. How to implement t

  • Can i use a usb to see films stored

    ok i want know if i can use the usb connection to view videos stored on the usb.

  • How to use the first row function value for the rest of records

    Hi all, I am having a select statement like this. We are calling function enabled for each row. So it is taking time. As per our bussiness logic, we can use what the function 'enabled' will give for the first row to other rows also. so that we can av