About upload

Hi,
i'm trying to upload a file, my code is as follows :
public boolean uploadFile()
        str = "ftp://" + "[email protected]" +":" + "123456"+ "@ftp." + "mysite.net/public_html/mydir/UTIR.zip";     
        try
            URLConnection conn = new URL(str).openConnection();
            conn.setDoInput(true);
            conn.setDoOutput(true);
            conn.setAllowUserInteraction(false);
            DataOutputStream dos = new DataOutputStream(conn.getOutputStream());
            byte data[] = new byte[1000];
            int count = 0;
            BufferedInputStream br = new BufferedInputStream(new FileInputStream(new File("E:\\my Drive\\UTIR.zip")));
            while((count = br.read(data, 0, 1000)) != -1)
                dos.write(data, 0, count);
            br.close();
            dos.close();
            return true;
        catch(Exception ee){ ee.printStackTrace(); return false;}
    }The following exception is being happend:
java.net.MalformedURLException: For input string: "[email protected]"
I could not trace it out, is there any problem in the connection string itself!!!
please help!!
Dev

format for upload is
ftp://userName:[email protected]:portNo/dir/anyFile.zip
In your case
=========
userName = acti
choyal.org/hostname = mysite.net
portNo = [email protected] * * * * *
otherpath as = public_html/mydir/UTIR.zip

Similar Messages

  • Question about upload file to sever in jsp.

    i found some articles about upload file in jsp, and most of suggested that the third party classes will be used.
    but i want to know the basic technology behind them, for example what kind of class needed ( using java.io.* as usual)
    and what the process for writing a file to sever.
    any document or url link useful will be very welcomed.
    best regards

    Uploading a file is similar to sending any other kind of data, except that it must be encoded differently than a standard HTML form... Typically you will set up your form like this:
    <form action="/upload" enctype="multipart/form-data" method="POST">
    <input type="file" name="myFile">
    </form>
    The enctype declaration is necessary -- your file won't arrive intact any other way. However, the JSP/Servlet specs don't provide any code to deal with forms which are encoded this way, so things like request.getParameter() don't work. You will either have to roll your own code, or use a third party library.
    For more information, see RFC 1867, File upload in HTTP:
    http://www.faqs.org/rfcs/rfc1867.html

  • About UPLOAD, GUI_UPLOAD and WS_UPLOAD

    Hello Experts,
             What is the difference between UPLOAD, GUI_UPLOAD and WS_UPLOAD function modules. Please send me brief answer about this on following mail id
    "[email protected]"
    Reward for useful answer
    Thanx and regards,
    Rahul Talele

    I would suggest to always use the GUI_UPLOAD.  I say this because this is the function module which is used in the GUI_UPLOAD method of the class CL_GUI_FRONTEND_SERVICES.   Really, you should probably use the class/method instead of the function module.
      data: filename type string.
      filename = p_file.
      call method cl_gui_frontend_services=>gui_upload
             exporting
                  filename                = filename
                  filetype                = 'ASC'
             changing
                  data_tab                = iflatf
             exceptions
                  file_open_error         = 1
                  file_read_error         = 2
                  no_batch                = 3
                  gui_refuse_filetransfer = 4
                  no_authority            = 6
                  unknown_error           = 7
                  bad_data_format         = 8
                  unknown_dp_error        = 12
                  access_denied           = 13
                  others                  = 17.
    Regards,
    Rich Heilman

  • General question about uploading web apps

    i have my site completed and it works on the testing server
    without a glitch. i've uploaded static sites before without a
    hitch, but i'm not so certain about web apps. seems when you upload
    the site with dw, it uploads the html and php . . . but then there
    are the tables from the db. uploading them and getting them to hook
    up all over again . . . how do you do that? can someone review the
    steps please. thanks.

    something like this:
    1. check your remote server has phpMyAdmin installed and the
    URL to
    access it (phpMyAdmin is a web app written in PHP and you
    access it
    through a browser)
    2. download and install phpMyAdmin locally
    3. run phpMyAdmin, usually
    http://localhost/phpMyAdmin,
    but the url will
    vary depending the installation and your development
    platform.
    export your local DB; phpMyAdmin will create a file named by
    default
    "localhost.sql". depending your browser configuratioon you
    can change
    the file name/choose where to save
    4. run phpMyAdmin in the remote server and import your DB
    just choosing
    the file in step 3
    later you can export/import tables instead the full DB. if
    you're
    reimporting the DB remember to check the "Add DROP DATABASE"
    checkbox
    when exporting
    you can't see any files in the server with phpMyAdmin, it's
    only a
    visual interface to the MySQL server. keep using DW to
    create/modify/upload html, js and php files
    hconnorjr wrote:
    > so the steps go something like this:
    > 1. find db to upload from testing server
    > 2. go to new server. find the directory that is used for
    databases (presumably
    > one that the admin has already set up for apache/php to
    look for db tables.
    > make a db of the same name as in your testing server.
    > 3. use phpMyadmin on the testing server and make backup
    of your db. since its
    > new for the production server use the default values. in
    this step the db can
    > also be backed up by tables if its large and upload time
    might be an issue.
    > 4. go the the new server. with the phpMyadmin on that
    server, name a database
    > with the same name as the one on the testing server. use
    IMPORT. go to the
    > browse button and find the db on your testing server and
    IMPORT it.
    >
    > small question: i can see the files on the remote server
    from dw when its
    > properly set up, but does phpMyadmin allow me to see
    files on my testing server
    > without some configuration?
    >

  • 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>

  • Question about uploading file to Azure Storage

    Can we upload ISO to azure storage and deploy to Azure Virtual Machine?

    hi Abdul,
    Yes. Please see those tutorials:
    windows server:
    http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-create-upload-vhd-windows-server/
    Linux:
    http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-create-upload-vhd/
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Question about uploading videos/movies

    hi guys and gals
    i just recently bought a 30GB ipod video for my little cousin and he asked me a question that i do not have an answer to.
    he knows how to upload music from his itunes to his ipod (drag music into the ipod icon) but he can't figure out how to upload movies/videos.
    i know that the format of the video has to be quicktime or something that is compatible with mac. he uses windows and i believe his videos are AVI or some weird nonesense.
    can you please, in easy steps, tell me how to upload videos into the ipod? thanks!

    Upload videos same way you do songs-just drag them over if you haven't enabled autoupdate.
    Videos have to be in a specific format, found under iPod tech specs on apple website.
    Here:
    H.264 video: up to 768 Kbps, 320 x 240, 30 frames per sec., Baseline Profile up to Level 1.3 with AAC-LC up to 160 Kbps, 48 Khz, stereo audio in .m4v, .mp4 and .mov file formats
    MPEG-4 video: up to 2.5 mbps, 480 x 480, 30 frames per sec., Simple Profile with AAC-LC up to 160 Kbps, 48 Khz, stereo audio in .m4v, .mp4 and .mov file formats

  • Question About Uploading XML Sitemap

    Hi Folks!
    I uploaded an XML Sitemap well over a year ago. I've created alot of new content since then so I created a new Sitemap.
    I see my old sitemap.xml in my site, along with a sitemap.xml-bkp
    Before I upload the new one, should I delete those other two?

    An XML SiteMap is mainly for Search Engine robots to crawl your site.  It's not for humans.
    After uploading your map to the root folder of your web site, it's good to tell Google where to find it with your Google Webmaster Tools.
    https://www.google.com/webmasters/
    Nancy O.

  • Question about Upload..

    Hello,
    I want to create a program that gets a location of a file (string)
    and uploads the file on [http://imageshack.us]
    and returns the address of the uploaded picture.
    I know how to use sockets ,
    I can create a socket that connects to [http://imageshack.us] using this line
    Socket mySocket=new Socket("http://imageshack.us" , 80);but I dont have a clue which request I need to send to upload the image and to get the image's address.
    anyone have any clue or any information that can be useful ?
    thanks to the helpers.

    You could do this with sockets if you like, but you'll have to learn the details of the HTTP protocol to get the answer to your question. If you really want to do it that way, then find the HTTP RFC's on the web and start reading them.
    Personally I would use Apache HttpClient to deal with all those details. I would expect that authentication is going to be just one of the things you have to take care of.

  • Urgen question about uploading clips (the 1000th post about it probably)

    I uploaded a video which was in .mpg format. Imovie says that .mpg is incompatible for imovie, so i converted the video into an .avi format which does allow it. The problem is when i directly upload an .avi video into imovie it uploads perfectly and i can see it in the event, but when i convert the video into a compatible video format, it loads but it wont show up in the event. Please help me, and if you do not understand the question then please inform me so i can rephrase it. Thank you very much

    im using any video converter, but whatever i convert it to, it ends up doing the same thing

  • HT4858 Confused about uploads vs. what gets saved in Photo Stream

    According to this article, you can upload 10,000 photos/day to Photo Stream, but apparently (not mentioned in this article) you can only keep 1,000 photos in your photo stream? Is that right? Then what is the point of being able to upload 10,000 per day, if only 1,000 of those will get saved? I'm confused.

    You're welcome.  Since photo stream is completely free, and doesn't use your iCloud storage plan, Apple has to put some limits on it.  It's really desiged to sync photos across your devices temporarily (30 days), giving you time to save the photos you want to keep.  If you have a Mac, you can also set iPhoto to automatically save photo stream photos to your iPhoto library for permanent archieval; don't know if there is a similare option on the Windows side.
    If you're on vacation, you might want to use an alternative cloud storage option like Dropbox.  You could use then use the Dropbox app to upload all the photos you want, provided you purchase sufficient storage, and they would be kept permanently until removed.

  • About uploading files

    I use a JDeveloper 11g TP4 and I want to upload files to server I read a a file upload in Developer’s Guide but I did not understand how can I upload files I want to :
    1- upload only image files.( I want to restrict the user to upload only one type of file as image only or PDF only... )
    2- in server I want to rename a file and save a file to specific place ( in hard disk ) and svae the file path to a database.
    Is there any one can help me??
    Thank You

    Hi,
    +1- upload only image files.( I want to restrict the user to upload only one type of file as image only or PDF only... )+
    you can't change the list filter as it is defined by the browser
    +2- in server I want to rename a file and save a file to specific place ( in hard disk ) and svae the file path to a database.+
    you can configure the file upload in the web.xml file to load into a specific location. See http://download-uk.oracle.com/docs/html/B25947_01/web_complex006.htm#CEGCEDHF
    Its 10.1.3 based, but works the same in 11
    Frank

  • Question about Uploading

    I recently had a harddrive problem with my PC, and it happened to be the drive with all my songs on it and iTunes.
    Is there any way I can
    A. Get the songs from my iPod to my PC
    or B. Keep the songs from getting deleted when I upload my iPod.
    I have 1700 songs on my iPod and I would like to keep them there ^^'
    Thanks,
    Cam

    There are a number of third party utilities you can use to retrieve the files from your iPod. This is just a selection.
    YamiPod Mac and Windows Versions
    PodUtil Mac and Windows Versions
    iPodCopy Mac and Windows Versions
    PodPlayer Windows Only
    PodPlus Windows Only
    Have a look at the web pages and documentation for these and pick one you are happy with, they are generally quite straightforward. There is also a manual method of accessing the iPod's hard drive on Windows posted in this thread: MacMuse - iPod to iTunes
    You can use a keyboard command to prevent your iPod auto-syncing with iTunes. While connecting the iPod to the computer hold down the Shift + Ctrl keys (on a Mac hold down the Option and Command (⌥ and ⌘) keys). This will stop the iPod from auto-syncing with iTunes and the iPod will appear in the source list. Wait until you are sure the iPod has mounted, and that it will not auto sync and then you can let the keys go. This may take between 3 and 30 seconds depending on your computer. Then go to Preferences>iPod and check the "Manually manage songs and playlists" box.
    If at any stage iTunes brings up a dialogue window asking whether you want to replace the songs on your iPod with the songs in iTunes, press *No*. Pressing "Yes" will irretrievably remove all songs from your iPod.
    Keep your iPod in manual mode until you have reloaded your iTunes and you are happy with your playlists etc then it will be safe to return it auto-sync again.

  • A bug about upload

    If you select a diffient document when you upload a document immeditely,dw will upload the new document ,but the one you want.
    My englist is very poor,I want you can understand me.
    In Chinese:
    当你选择一个文件上传的时候,如果尚未开始,你不小心选择了新的文件,dw就会把新选择的传上去,而不是你想上传的那个文件。

    It's not a bug, but it's true, it can happen in certain scenarios. Here's a post on this issue and how to solve it:
    http://oraclemiddleware.wordpress.com/2012/01/30/java-lang-classnotfoundexception-weblogic-nodemanager-server-provider-weblogiccacheserver/

  • About uploading file

    i wanto upload my files, via GPRS/WAP. here is my code.
    HttpConnection httpConnection = null;
    FileConnection fileConnection = null;
    byte[] data = null;
    boolean fileRead = false;
    InputStream in = null;
    OutputStream out = null;
    try
    if(file.substring(0, 5).toLowerCase().compareTo("file:") == 0)
    fileConnection = (FileConnection)Connector.open(file, Connector.READ);
    if(fileConnection.exists() && fileConnection.canRead())
    if((in = fileConnection.openInputStream()) != null)
    long temp = fileConnection.fileSize();
    data = new byte[(int)temp];
    in.read(data);
    fileRead = true; //flag
    else
    if((in = this.getClass().getResourceAsStream(file)) != null)
    int temp = in.available();
    data = new byte[temp];
    in.read(data);
         fileRead = true; //flag
    if(fileRead)
    String title = file.substring(file.lastIndexOf('/') + 1, file.length());
    if((httpConnection = (HttpConnection)Connector.open(url)) != null)
    httpConnection.setRequestMethod(HttpConnection.POST);
    httpConnection.setRequestProperty("Connection", "keep-alive");
    httpConnection.setRequestProperty("Content-Length", pjg);
    if((out = httpConnection.openOutputStream()) != null)
    if(this.allowed)
    out.write(";|;`;~;title;|;`;~;".getBytes());
    out.write(title.getBytes());
    if(Thread.currentThread() == this.sendThread)
    this.repaint();
    if(this.allowed)
    out.write(";|;`;~;data;|;`;~;".getBytes()); //separator from filename and file data (do not change)
    out.write(data);
    if(Thread.currentThread() == this.sendThread)
    this.repaint();
    if(data1 != null && this.allowed)
    out.write(";|;`;~;data1;|;`;~;".getBytes());
    out.write(data1.getBytes());
    if(Thread.currentThread() == this.sendThread)
    this.repaint();
    if(data2 != null && this.allowed)
    out.write(";|;`;~;data2;|;`;~;".getBytes());
    out.write(data2.getBytes());
    if(Thread.currentThread() == this.sendThread)
    this.repaint();
    if(data3 != null && this.allowed)
    out.write(";|;`;~;data3;|;`;~;".getBytes());
    out.write(data3.getBytes());
    if(Thread.currentThread() == this.sendThread)
    this.repaint();
    if(data4 != null && this.allowed)
    out.write(";|;`;~;data4;|;`;~;".getBytes());
    out.write(data4.getBytes());
    if(Thread.currentThread() == this.sendThread)
    this.repaint();
    if(this.allowed)
    out.write(";|;`;~;end;|;`;~;".getBytes());
    int rc = 0;
    try
    out.flush();
    rc = httpConnection.getResponseCode();
    if(rc == httpConnection.HTTP_OK)
    return true;
    catch (Exception e)
    this.error_code = "021";
    }// fileRead
    return false;
    catch(Exception e)
    e.printStackTrace();
    return false;
    finally
    try
    if(httpConnection != null)
    httpConnection.close();
    if(fileConnection != null)
    fileConnection.close();
    if(in != null)
    in.close();
    if(out != null)
    out.close();
    System.gc();
    catch(Exception e)
    e.printStackTrace();
    is there anything wrong ?
    why cant i upload my files... it alwasy end up error..

    hi Abdul,
    Yes. Please see those tutorials:
    windows server:
    http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-create-upload-vhd-windows-server/
    Linux:
    http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-create-upload-vhd/
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • From: header being changed in Mail 2.1

    My Mac is on a small LAN I set up in my house to enable multiple Net access with only one phone line.  To send mail I have to use the SMTP server that goes with the other computer on the network, though incoming mail comes to me via a quite different

  • Transferring my library to a new computer - errors galore

    I recently purchased a Retina iMac running OS 10.10.1.   My previous computer is a Mac Pro (2006) with 10.7.5 (latest OS it will support).  The Mac Pro has iTunes 12.0.1 with the database files on the system hard drive and the media files on a second

  • ACL rights assignment in new user script

    I've been tasked with converting an old new-user script that runs at least once a day written in VB to PowerShell. This script takes as input a CSV file we get from HR that has all necessary info and creates a user, adds them to specific groups based

  • Netflix logon screen security issue

    I have scoured the net for an answer to this. I have 3 PC's with WMC/7. I use an HD Homerun Prime. Yesterday WMC would not play Netflix, reporting; The security certificate presented by this website is not secure. Security certificate problems may in

  • Generating a link to a song on iTunes store

    How do i generate a link to a song on iTunes store?  I would then use this link in my blog, on my web page, etc.