Error in uploading files on remote host

hello all
i use commons-net-2.2.jar for connection to my FTP account and managing my directories and uploading files on the remote server
i use the below statements for 1- connecting to my ftp account of my host 2- listing files on the htdocs/images directory of my host and 3-uploading a file on my host
firstly i import this classes from commons-net.jar to my servlet
*import org.apache.commons.net.ftp.FTP;*
*import org.apache.commons.net.ftp.FTPClient;*
*import org.apache.commons.net.ftp.FTPFile;*
*import org.apache.commons.net.ftp.FTPReply;*
then i connet from ftp protocol to the remote host
*FTPClient client = new FTPClient();*
            *// Connect to the FTP server as anonymous*
            *client.connect("www.salekan.ir");// setting ftp host*
            *client.login( "MyUsername", "MyPassword" ); //setting ftp username and password*
            *client.setFileType(FTP.BINARY_FILE_TYPE);*
            *String remoteDir = "/htdocs/images";*
            *client.changeWorkingDirectory(remoteDir);// change working directory to htdocs/images*
            *int reply=client.getReplyCode();*
            *if(FTPReply.isPositiveCompletion(reply)){// testing the connection*
                *out.print("Connected Success...<br/>");*
then listing the files on the htdocs/images directory by this statements
Code:
*FTPFile[] remoteFiles = client.listFiles();//listing files on the folder to a array*
            *out.print( "Files in " + remoteDir+" count= "+ remoteFiles.length +"<br/>" );*
            *for (int i = 0; i < remoteFiles.length; i++) {*
                *String name = remoteFiles.getName( );*
*long length = remoteFiles[i].getSize( );*
out.print( name + ":\t\t" + length +"<br/>" );
and finally i tried to upload text1.txt file to the working directory of the remote server and then disconnect
Code:
File file=new File("c:\\text1.txt");
*if(file.isFile()){*
out.print("<br/>"+file.getName()+"<br/>");
InputStream in=new FileInputStream(file);
client.storeFile(file.getName(), in);
out.print("Uploading Success");
client.disconnect( );
when i run this web app and this servlet on my computer and localhost this servlet execute correctly and the file upload on the server correctly
but when i send this web app and run from there step1: connecting to the host using ftp protocole and step2: listing the files execute correctly but step3:uploading file on the server dont run and don't send any errors(run incorrectly)
Edited by: EJP on 7/02/2011 11:45: used the code tags. Please copy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

step3:uploading file on the server dont run and don't send any errors(run incorrectly)Please make up your mind. Either it doesn't run or it runs incorrectly. Which is it? and if 'incorrectly', please define 'incorrect'.

Similar Messages

  • Sshd error while deploying agent to remote host

    Hi,
    Am getting the following error while deploying agent to remote host.
    SSH Setup failed on nodes: localhost. SSH setup failed because of any of the following reasons:
    sshd has gone down while doing SSH setup.
    The platform of the provided hosts may be incorrect. Please verify it.
    Fix above problems and Continue OR do manual ssh setup running command: "<OMS_HOME>/sysman/prov/resources/scripts/sshUserSetupNT.sh -hosts "user-pc" -user karthick -localPlatformGrp win -asUser SYSTEM [-asUserGrp root] -sshLocalDir \.ssh -homeDir $HOME". Check the log file at <OMS_HOME>\sysman\prov\agentpush\2011-08-18_10-45-16-AM\logs\sshSetup2011-08-18_11-19-21-AM.log for more information.
    I tried the following from both the host and working fine.
    ssh host1 date from host2
    ssh host2 date from host1
    When I try to do the manual ssh setup running the cmd
    $ sh sshUserSetupNT.sh -hosts "user-pc" -user karthick -localPlatformGrp win -asUser SYSTEM [-asUserGrp root] -sshLocalDir \.ssh -homeDir $HOME
    sshUserSetupNT.sh: line 17: $'\r': command not found
    sshUserSetupNT.sh: line 20: $'\r': command not found
    sshUserSetupNT.sh: line 27: $'\r': command not found
    sshUserSetupNT.sh: line 231: syntax error near unexpected token `elif'
    'shUserSetupNT.sh: line 231: ` elif ! test -f "$CLUSTER_CONFIGURATION_FILE"
    Getting the above error.
    Pls let me know how to fix this issue.
    Thanks in advance,
    -KarthicK

    Hi KarthicK,
    please have a look at the following forum discussion: How to install Oracle Grid Agent 11g into windows hosts ?
    The post of hani430 appears to be what you are looking for.
    Regards,
    Frank

  • Error while uploading file in BPS

    Hi all,
    I am getting an error while uploading file to BPS through web interface
    I get a red stop button with error message : error while calling up RFC.
    when i double click the red stop button, i get no long text but the error message I get is UPC 202
    please advice me to resolve this issue.
    many thanks in advance,
    Ravi

    The informations are really not much to have an idea about the problem.
    The problem can be located in the fm that calls the file because is trying to search the file on a system where there are some kind of problems in the communication between the systems involved to read and pass the file. Did u map the file name with logical filenames ? Very strange problem. Can you browse in the server where the file is located . Is it on your pc ?
    Or, there is some problem in the datas provided, but this problem should arise more when you save than when you just press to load.
    With this kind of imformations is very hard to have an idea. You need to debug to see what s going on
    Regards

  • Error while uploading file into KM

    Hi Experts,
    I m getting error while uploading file into KM. Its throwing an error message like " Syngenta-POC.doc" does not exist, or file is empty; you cannot upload empty files"
    please assists me.

    Shantanu,
    Please check the files which you are upload is empty or unknown format. If everything seems valid then try to check for the corresponding SAP Note in service.sap.com
    Ram

  • Error when uploading file : Return code = 6 in LSMW

    Hello All,
    Getting the bleow mentioned error in LSMW.
    Error when uploading file Return code = 6 )
    Is it related to access. please suggest.

    did you define the file in step 7 without any error and allocate in step 8 without any error before? 
    I mean in the same system where you execute the read step.
    Make sure you have the file not open when you execute the read step.

  • LSMW: "Error in Uploading File" error code 6

    Hi All,
    I have created a simple LSMW project for deletion of Purchase Requisition in Development server. It is working as per the requirement there. But when I tried to Export the project and import it into our Production Server, system gives "Error in Uploading file".
    Hence, I recreated the project in Production system. Here again when I reached the step "Read Data" the same error occured. I wanted system to read the Purchase requisition numbers from a text file which i have already mapped in the steps previous to " Read Data".
    Also, system says "Error Code 6"
    Can anyone please highlight possible causes of this error message?
    Regards,
    Vishal Data

    Hi,
    first you have to check TEXT file data - why because you are tested in Development server with test data , but that same test date not available in Production server na
    prepare PR numbers from Production server -convert into Txt. format
    while running LSMW - close all Excel file and Text file ,
    at the time of Import and Export - system will start Specify Files- item - that time you will give Production data Text file then Upload
    I think now you can't face any error
    Mahesh

  • UCCE / IPIVR : Error while uploading file. Please try again later.

    IPIVR version 8.5x
    Receive "Error while uploading file. Please try again later" 
    Renamed the script to a different name and still could not upload.   I am able to upload other scripts without any issue.   I did find the ICM subsystem in partial service.   If that was the issue I would think it would cause an issue with all the scripts.   The script does validate.   Not sure why at this point.

    Hi Aditya,
    Are you using  SharePoint 2010 or SharePoint 2013?
    Did this issue occur for all users or the special user?
    Please go to Central Administration->Manage service applications->User Profile service application->manage user profile, search and edit the user profile, then upload a picture for the user, compare the result.
    In addition, please check the log file to check more information about this issue.
    The path of the log file is:
    SharePoint 2010: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\LOGS
    SharePoint 2013: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\LOGS
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • Error when uploading file :( Return code = 6 )

    Hello All,
    Getting the bleow mentioned error in LSMW.
    Error when uploading file Return code = 6 )
    Is it related to access. please suggest.

    Hi,
    If the Sy-Subrc is 0 then Success,
             Sy-SUBRC is 4 then failure,
             Sy-SUBRC = 6 then the user might be not access to read the file.
    This is due to authorization issue.

  • File upload error: Error uploading file. Error moving uploaded file from temporary folder. (FILE_UPL

    what causes this error:
    File upload error: Error uploading file. Error moving uploaded file from temporary folder. (FILE_UPLOAD_ERROR)

    On 5/17/07 4:26 PM, in article [email protected],
    "Gü[email protected]" <> wrote:
    >
    > To my experience servers behave differently -- on some I really had to use
    > 777, others are happy with 755.
    >
    > in regards to "any user" :: On most ADDT respectively MX Kollection - based
    > backends I made the image & file upload feature available to user having e.g.
    > the "levels" 1 & 2, but not 3 -- I wouldn´t expose something like this to all
    > users
    >
    > Günter Schenk
    > Adobe Community Expert, Dreamweaver
    My backend is only for admin, so they are the only ones who can access the
    upload pages. My concern is an images folder on the site being 777. Can't
    anyone from the outside plant a file in that folder if they just know where
    to find it using an ftp program? ?

  • Browsing file at remote host

    Does anyone know how to browse file at remote host ?
    Its features are similar with windows explorer.
    I've found JTreeTable article written by Philip Milne which
    is like windows explorer, but how to make it has
    capability browsing file at remote host ?
    Any idea, what steps I have to do ?

    You need a program running on the remote host that can collect the directory structure and return it to the client. If you are using java at both ends, then this is a pretty straight-forward process. If you use cgi, it is a little more complicated, but not at all difficult.

  • Help with uploading files to remote site

    I am trying to upload files onto a remote site, but it keeps
    timing out. Also, on my new website that i'm making for a client,
    when i Put the files onto the remote site it says Started:
    5/30/06 7:57 PM
    index.html - error occurred - An FTP error occurred - cannot
    put index.html. Access Denied. The file may not exist, or there
    could be a permission problem.
    File activity incomplete. 1 file(s) or folder(s) were not
    completed.
    Files with errors: 1
    index.html
    Finished: 5/30/06 7:57 PM
    What does this mean? why are the file incomplete?
    Mike S

    Have you successfully uploaded to this site before?
    Is your site definition configured to upload to the proper
    remote folder?
    The error message is simply telling you the transfer did not
    succeed
    "mikesilverman22" <[email protected]> wrote
    in message
    news:e5im76$r17$[email protected]..
    >I am trying to upload files onto a remote site, but it
    keeps timing out.
    >Also,
    > on my new website that i'm making for a client, when i
    Put the files onto
    > the
    > remote site it says Started:
    >
    > 5/30/06 7:57 PM
    >
    > index.html - error occurred - An FTP error occurred -
    cannot put
    > index.html.
    > Access Denied. The file may not exist, or there could be
    a permission
    > problem.
    >
    > File activity incomplete. 1 file(s) or folder(s) were
    not completed.
    >
    > Files with errors: 1
    > index.html
    >
    > Finished: 5/30/06 7:57 PM
    >
    > What does this mean? why are the file incomplete?
    >
    > Mike S
    >

  • Error message ftp-connection to remote host

    hi guys,
    i have problems with a ftp-connection between a business-service (alsb) and a remote-host.( we used alsb 2.6 rp1)
    i pick-up a file per ftp-proxy-service on a remote host. this is possible without problems. then i convert this file and i want to rewrite this file with a ftp-business-service back to the remotehost. but i get this error-message
    <con:errorCode>BEA-380000</con:errorCode>
    <con:reason>
    General runtime error: Received error response (502) from FTP server [scylla.ce.ced] IP [10.1.224.7] port [21] status [connected] upon executing command [port 192,168,122,254,12,86]
    who can help me??
    regards thomas

    Open up your site definition (double-click on the site name in the File panel or choose Site > Manage Sites > Edit) and go to the Remote Info category. There, click Use Firewall (if it isn't already selected) - press Test to try the default firewall settings. If that doesn't work, click Firewall Settings. You'll see two relevant settings about 2/3 down - Firewall host and Firewall port. If Firewall port is 21, there probably is something blocking the port.
    On Windows XP, you may have the Windows Firewall installed and blocking. Here's how you get to it:
    To open Windows Firewall
    1.
    Click Start and then click Control Panel.
    2.
    In the control panel, click Windows Security Center.
    3.
    Click Windows Firewall.
    Once you have that open, you'll need to set Dreamweaver as an exception to blocking:
    On the Exceptions tab, click Add                     Program.
    In the list of programs, click the name of the program (Dreamweaver) that you                     want to add, and then click OK. If the name of your program is                     not in the list of programs, click Browse to locate the Dreamweaver.exe in the Program Files folder and then click OK.
    Hope this helps - Joe
    Joseph Lowery
    Author, Dreamweaver CS4 Bible

  • Error in Upload file-table or view does not exist-wwv_flow_file_objects$

    Hi,
    i am trying to upload a file and then store the contents of the file into one of my tables in the schema.I wrote one package for uploading the file and then a process to insert each record in the uploaded file to the table in my schema.When i try compiling the package it gives an error.
    PL/SQL: ORA-00942: table or view does not exist
    The name of the table is wwv_flow_file_objects$
    The package is as follows-
    CREATE OR REPLACE PACKAGE BODY Text_File_Pkg AS
    FUNCTION get_file_lines (
    p_file_name IN VARCHAR2,
    p_lines IN OUT line_tab_type,
    p_rec_sep IN VARCHAR2 DEFAULT dos_new_line
    ) RETURN INTEGER
    IS
    v_binary_file BLOB;
    v_text_file CLOB;
    v_dest_offset INTEGER := 1;
    v_src_offset INTEGER := 1;
    v_lang_context INTEGER := DBMS_LOB.default_lang_ctx;
    v_warning INTEGER;
    v_rec_sep_len CONSTANT INTEGER := LENGTH(p_rec_sep);
    v_start_pos INTEGER := 1;
    v_end_pos INTEGER := 1;
    v_line_num INTEGER := 1;
    v_file_length INTEGER;
    BEGIN
    IF p_file_name IS NULL
    THEN
    RETURN 1;
    END IF;
    IF p_rec_sep IS NULL
    THEN
    RETURN 2;
    END IF;
    SELECT blob_content
    INTO v_binary_file
    FROM wwv_flow_file_objects$
    WHERE NAME = p_file_name
    AND (mime_type = 'text/plain' OR mime_type = 'application/octet-stream')
    AND doc_size &gt; 0;
    DBMS_LOB.createtemporary(v_text_file, TRUE);
    DBMS_LOB.converttoclob(v_text_file, v_binary_file,
    DBMS_LOB.lobmaxsize, v_dest_offset,
    v_src_offset, DBMS_LOB.default_csid,
    v_lang_context, v_warning);
    IF v_warning = DBMS_LOB.warn_inconvertible_char
    THEN
    -- Unable to convert file.
    RETURN 3;
    END IF;
    v_file_length := DBMS_LOB.getlength(v_text_file);
    LOOP
    EXIT WHEN v_start_pos &gt; v_file_length;
    v_end_pos := DBMS_LOB.INSTR(v_text_file, p_rec_sep, v_start_pos);
    IF v_end_pos = 0
    THEN
    v_end_pos := v_file_length + 1;
    END IF;
    IF (v_end_pos - v_start_pos) &gt; 4000
    THEN
    -- Line exceeds 4000 characters.
    RETURN 4;
    END IF;
    p_lines(v_line_num) := DBMS_LOB.SUBSTR(v_text_file, v_end_pos - v_start_pos, v_start_pos);
    v_line_num := v_line_num + 1;
    v_start_pos := v_end_pos + v_rec_sep_len;
    END LOOP;
    RETURN 0;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    RETURN 5;
    END get_file_lines;
    END Text_File_Pkg;
    Any suggestions.
    Many Thanks,
    Sanjai

    Hi,
    i am trying to upload a file and then store the contents of the file into one of my tables in the schema.I wrote one package for uploading the file and then a process to insert each record in the uploaded file to the table in my schema.When i try compiling the package it gives an error.
    PL/SQL: ORA-00942: table or view does not exist
    The name of the table is wwv_flow_file_objects$
    The package is as follows-
    CREATE OR REPLACE PACKAGE BODY Text_File_Pkg AS
    FUNCTION get_file_lines (
    p_file_name IN VARCHAR2,
    p_lines IN OUT line_tab_type,
    p_rec_sep IN VARCHAR2 DEFAULT dos_new_line
    ) RETURN INTEGER
    IS
    v_binary_file BLOB;
    v_text_file CLOB;
    v_dest_offset INTEGER := 1;
    v_src_offset INTEGER := 1;
    v_lang_context INTEGER := DBMS_LOB.default_lang_ctx;
    v_warning INTEGER;
    v_rec_sep_len CONSTANT INTEGER := LENGTH(p_rec_sep);
    v_start_pos INTEGER := 1;
    v_end_pos INTEGER := 1;
    v_line_num INTEGER := 1;
    v_file_length INTEGER;
    BEGIN
    IF p_file_name IS NULL
    THEN
    RETURN 1;
    END IF;
    IF p_rec_sep IS NULL
    THEN
    RETURN 2;
    END IF;
    SELECT blob_content
    INTO v_binary_file
    FROM wwv_flow_file_objects$
    WHERE NAME = p_file_name
    AND (mime_type = 'text/plain' OR mime_type = 'application/octet-stream')
    AND doc_size &gt; 0;
    DBMS_LOB.createtemporary(v_text_file, TRUE);
    DBMS_LOB.converttoclob(v_text_file, v_binary_file,
    DBMS_LOB.lobmaxsize, v_dest_offset,
    v_src_offset, DBMS_LOB.default_csid,
    v_lang_context, v_warning);
    IF v_warning = DBMS_LOB.warn_inconvertible_char
    THEN
    -- Unable to convert file.
    RETURN 3;
    END IF;
    v_file_length := DBMS_LOB.getlength(v_text_file);
    LOOP
    EXIT WHEN v_start_pos &gt; v_file_length;
    v_end_pos := DBMS_LOB.INSTR(v_text_file, p_rec_sep, v_start_pos);
    IF v_end_pos = 0
    THEN
    v_end_pos := v_file_length + 1;
    END IF;
    IF (v_end_pos - v_start_pos) &gt; 4000
    THEN
    -- Line exceeds 4000 characters.
    RETURN 4;
    END IF;
    p_lines(v_line_num) := DBMS_LOB.SUBSTR(v_text_file, v_end_pos - v_start_pos, v_start_pos);
    v_line_num := v_line_num + 1;
    v_start_pos := v_end_pos + v_rec_sep_len;
    END LOOP;
    RETURN 0;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    RETURN 5;
    END get_file_lines;
    END Text_File_Pkg;
    Any suggestions.
    Many Thanks,
    Sanjai

  • Do I need to have my site uploaded to a remote host for embeded formscentral form  to work? I am getting a broken section of header with a warning sign on top corner saying "!Local host." Cheers

    Hey there all.
    I am wondering if there is something wrong with my embedded form or if it is simply because
    I have not uploaded my site to remote host yet? I am only getting a broken part of the header with
    no actual form, with a warning "!local host" in top left hand corner. If anyone could enlighten
    me on this problem it would be greatly appreciated, it is my first time making forms

    Cheers, I noticed some browsers were treating the form differently. I am uploading to a test server tomorrow, hopefully all goes well, thanks for your reply  

  • Error in uploading file in lsmw

    while uploading file in lsmw I am getting an error as
    'File 'C:\cust_errors.txt'does not exist or is currently locked.'
    at the bottom of the screen.
    How to overcome this problem?

    Hi,
    Check if the file is being edited .
    save it and close it.
    Then try to upload from the step "Specify files".
    Regards,
    Hari Kiran

Maybe you are looking for

  • [Solved again] Updated to linux-3.10.8; Can no longer boot

    Hey everyone. So, linux-3.10.2-1 just dropped to the [testing] repos, and I got it through a standard -Syu. Along with it were upgraded libxfont, linux-headers, lirc-utils (and I installed extundelete during the same command). Here's the relevant bit

  • Database query from Java

    I'm writing a Java program that needs to query a Microsoft Access database. I'm not sure how to do this. Someone said to use ODBC drivers but I don't know what these are. Any clarification/ideas would be appreciated.

  • How to hide standard Iviews in MSS employee profile service

    Hi , I am on MSS Add on 1.0 . when I click on Team then employee infomration then employee profile. I can see details of employee. How to hide additional information like salary data , compensation information, apprisal which is part of standard deli

  • Seeing only "W" when I upload a Word document to iCloud

    Word documents worked in the past as I have severel uploaded but now when I upload a short Word document, the icon shows a sheet of paper with a big W in the middle instead of a mini icon with the format of the uploaded document. Using Microsoft Word

  • I can not open iphoto

    I am having trouble opening iphoto. it just says "iphoto cannot be open because of problem" ...I've reinstaled it and nothing. I have also tried repairing it using the disk utility and it still dont work. This is what it says: Process:         iPhoto