FTP in a Java program.

Hello all,
Im wondering, is there an FTP api for Java?
Id like to make my programs update my website if thats at all possible, just uploading jpegs and xml files from a program Ive been writing which organises my photographs. Ive got a website hosted by fatcow. Here is a list of their features, http://www.fatcow.com/fatcow/fatcow.bml?page=features. It says FTP access so thats no problem if its doable with Java.
If not through FTP, how else would I go about updloading to my website with java programs?
Thanks in advance.
Edited by: Gunjack on Nov 5, 2009 7:03 AM

Gunjack wrote:
Thanks dudes, sorry for being a tard.
Any idea why images I upload might come out like this?
http://gazmus.fatcow.com/brian.jpg
Looked normal when it was on my computer, weird once it went onto my site :(Please define normal. Is sadistic gay hairy dwarf porn "normal" in your world?
I kill me. ;-)
Cheers Keith.
PS: No offence intended to hairy gay dwarfs. If you're into sadism, that's your business.

Similar Messages

  • Invoking telnet/ftp from a Java Program

    How do I invoke telnet/ftp from a Java Program.
    I tried Runtime.getRuntime().exec("telnet x.x.x.x")
    where x.x.x.x is the IP address from my XP machine but doesn't work.
    Thanks

    import sun.net.ftp.*;
    import sun.net.TelnetInputStream;
    import java.io.*;
    class ex_ftp01 {
    public static void main(String[] args) {
    try {
    int i;
    String server = "xx.xx.xx.xx";
    String user = "yy";
    String passwd = "zz";
    FtpClient client = new FtpClient();
    client.openServer(server);
    client.login(user,passwd);
    System.out.println("Logined");
    // client.binary();
    client.cd("/xx");
    TelnetInputStream in = client.get("abc.txt");
    BufferedReader d = new BufferedReader(new InputStreamReader(in))
    while (( i = d.read()) != -1 ) {
    System.out.write(i);
    System.out.println("End of reading");
    catch (Exception e) {
    System.out.println(e);
    }

  • Accessing Sql Server from AS400 Java program

    Hi everybody,
    I am trying to access Sql Server from an AS400 Java program. I have tried various Sql Server JDBC drivers including the Microsoft one but no luck yet. When i try to compile my Java program (with driver file in the classpath) it gives some errors on the driver jar file and also it throws out lots of unreadable text characters. This gave me a feeling that probably its a character coding issue with the jar file, so i tried ftp the file in binary mode as well as copying through the Operations Navigator. But still compilation is giving the same kind of errors.
    Do I need to have some special JDBC Drivers compiled for AS400 specifically. My understanding was that Java is platform independent so any JDBC Type 4 driver will work.
    We are running Java 1.3 on the AS400. Any help on this issue would be great.
    Thanks
    Inder

    Thanks for the help. I am writing a Java program after a long time that's why was making that mistake. Now the program gets compiled correctly but on running the program i am getting the following error message:
    java 001-0070: Exception JVAB544 not expected
    /myjava/test/msbase.jar: 001-0050 Syntax error on Line 1: token ')' not expected
    /myjava/test/msutil.jar: 001-0050 Syntax error on Line 1: token ')' not expected
    /myjava/test/mssqlserver.jar: 001-0050 Syntax error on Line 1: token ')' not expected
    I have no idea what is this error about. Though the same driver files don't give any error when running on a Windows machine.
    Thanks

  • Need help on data coversion to be read by Java program

    Hello everyone,
    I have a challenging project to generate reports from MVS (mainframe) data and using Java as the programming language to read this data and generate reports. The Java program will execute on Wintel platform and AIX/UNIX platform.
    The data that I need to read (DCOLLECT idcams utility) is in binary/EBCDIC variable record format and resides in mainframe and transmitted via FTP to wintel platform.
    I tried converting the data to ASCII format before tranferering but the transfered data seems to be wrapped around and not sure how to handle it. I could transfer the whole thing in binary format and then read and convert at the same time( I believe Java can read EBCDIC accoding to my notes).
    I am sure some one have done this once before and I do not want to reinvent the wheel againg. I need your help in what direction to take for best aproach reading this data.
    Your suggestions would be appreciated
    Thanks
    Ulises (arsi)

    Thanks for you replies guys!
    I need to use java because the ultimate reporting tool
    is going to be a service developed in Jini.
    The reason I believe the data seem to be wrapped
    around after ftp transfer is because when I edited
    (TSO FSE from MVS) all text data is aligned withing
    the same column.
    After data is transmitted via FTP (converted to ASCII
    during trasmition) and edited with wordpad, text
    characters do not seem to be on the same possition.
    They are scattered all over the display area. Is
    possible this could be a display affect from winword
    but not sure.
    The MVS job to FTP the file follows:
    //STEP01 EXEC PGM=FTP,
    // PARM='FTP.MIAMIDADE.GOV (EXIT'
    //SYSPRINT DD SYSOUT=*
    //OUTPUT DD SYSOUT=*
    //SYSIN DD *
    user-name/password
    CD /storage
    CD UAL
    ASCII
    PUT 'STORAGE.DCOLLECT.TYPV' 'DCOLLECT_TYPEV.TXT'
    ls -l
    close
    quit
    Words of advice appreciated
    Ulises (arsi)
    YES! 1st mistake ... don't use WordPad for this ... your NotePad, Dos, or some other pure text editor.

  • How can I trasfer file using java program (from NT to Unix)

    Hi all,
    I want to transfer a text file from Windows NT to Unix machine inside the Java program.
    How should i do it.
    Thanks in advance.
    Regards
    Rajeev

    you have several options:
    - make your system administrator software install software on Unix and NT so that you can see a directory on the Unix machine from your NT machine, and just copy the file there
    - use FTP to put the file on the Unix machine
    Jesper

  • Error while running a Java Program

    Can anyone help me,
    I am getting the following error while running a Java program, Below is the exception thrown, please help.
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RESummer1.run(RESummer1.java:505)
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RECollectCont.run(RECollectCont.java:304)

    Ok, let's see. Write the following class:
    public class Grunt {
      public static void main(String[] args) {
        System.out.println("Hello Mars");
    }Save it as "C:\Grunt.java", compile by typing:
    javac c:\Grunt.javaRun by typing:
    java -classpath "C:\" GruntDoes it say "Hello Mars"? If yes, go back to your program and compare for differences (maybe you used the "package" statement?).
    Regards

  • Running a java program a set number of times

    This is a general question. Is it possible to make a java program run only 5 times for the sake of arguement.
    Basically I want to write a program that will give the user some flexibility when it will actually run another Java program, but I only want them to be able to say "not now' for a set number of times. When the last time comes the other program will launch. I was initially thinking of the Do Whilw loop, but this needs to work when the program is restarted.
    Program starts, it has 5 times it will run before it does something else(doesn't really matter now I think). User takes option "Not Now" and the program ends, but warns the user this will run 4 more times before you will need to do something.
    This process will repeat until the user takes the option "Ok install now" or the time limit expires and the install occurs anyway. Can someone point me in the right direction.

    ok I see so it's like one those programs that you download for free on the internet and they give you a set amount times to use it before you have to pay for it. but in this case when the number of times you use it equals 5 (or when the user clicks ok) a different java app will open automatically.
    My first thought would be to Write a Serialized object to disk using objectOutputStream that stores the number of times the application has been opened. and each time the program runs it checks for the serialized object and then you can do something like what I posted before. of course if were worried about security the user could always look for the object and erase it, if so then I guess we would have to come up with another plan of attack
    Hope this helps

  • Running a java program

    This shows how dumb i am.
    I have a java program all wrote. How can i run it without using the compiler? Can i have a .exe file or something that I just have to click on to run??
    Thanks again
    Agdude

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\Documents and Settings\awaguespack>cd jbproject\untitled1\classes\untitled1
    C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\untitled1>java
    form
    Exception in thread "main" java.lang.NoClassDefFoundError: form (wrong name: unt
    itled1/form)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\untitled1>dir
    Volume in drive C has no label.
    Volume Serial Number is C065-81CA
    Directory of C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\
    untitled1
    07/24/2003 02:21 PM <DIR> .
    07/24/2003 02:21 PM <DIR> ..
    07/24/2003 02:21 PM 7,655 form.class
    1 File(s) 7,655 bytes
    2 Dir(s) 36,031,016,960 bytes free
    C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\untitled1>echo
    %classpath%
    %classpath%
    C:\Documents and Settings\awaguespack\jbproject\untitled1\classes\untitled1>

  • Running a java program at "Start Up"

    Besides running an html file with an applet in it. Are there any simple ways to launch a java program every time the computer is turned on.
    I am not asking for specific directions, but rather just an idea, and i will go find my own guide.

    Well two ideas (if ur on windows) u could try are -
    one, if you had a class file you could simply create a
    batch file on windows that says java <class> and then
    put that batch file in your startup so that the class
    is run at startup or else you could think of modifying
    the registry keys on windows to run this class at
    startup - whichever works for you.Or you could just jar the program up, adding a Main-Class indicator in the manifest, and then add a shortcut to the jar to the startup folder, as someone else stated. Theres little need to go messing around with DOS batch in modern windows.

  • Running a java program from an icon

    I want to run my program from an icon on my desktop. I have a .bat file that I've built a shortcut to and it works.MY GUI program does display and run when I click on the icon. The problem is that the DOS window also shows up behind my GUI.
    Is there anyway to prevent the DOS window from showing? Or is there another way to run a Java program without resorting to a DOS command line or running it through FORTE or another IDD?

    Chris's solution worked well, with one small problem. Once my GUI starts, it takes up the whole screen. Normally when I run it, it appears as a small window.
    not a big problem, I can reduce it easily after it starts. But does anyone know a way to make it come up in the reduced size it norally comes up in when I run it from my IDE?

  • Running a java program via a batch file

    I am unable to run a java program from a batch file that I created.
    spiderpackage.EntryPoint is a class file which I am trying to run with a -v option to output something.What should I do to get the output?
    echo ^<html^>^<body^>
    echo hello^<br^>
    call java spiderpackage.EntryPoint -v
    echo ^</body^>^</html^>

    This has nothing to do with java programming. Have a look at the windows help for the call command.
    The echo <html> stuff doesn't make sense. What's it for?
    The command in you batch file should be:
    java -cp . spiderpackage.EntryPoint -v
    assuming that java is in the system path, and the EntryPoint.class is in a directory called spiderpackage which is a subdirectory of your current working directory

  • Running a Java program at startup in Linux

    Hello
    How do I run a Java program at startup in Linux? I know in Windows I can put a .bat file in C:\Windows\Start Menu\Programs\StartUp\ directory, but in Linux I have no idea how it is done.
    Thank you,
    Mihai

    This is really a Linux question, not Java.
    And then it depends on the version of Linux you are using.
    Maybe this will help, otherwise you should try on a forum for your version of Linux.

  • Running a java program in a directory other than the current directory

    How do I run a java program that's located in a directory other than the current directory?
    There is a file Test.java in /dir1/subdir1. If my current directory is anywhere other than that directory, say /dir2/subdir2, I can compile Test.java by using:
    javac -classpath /dir1/subdir1 /dir1/subdir1/Test.java
    But when I try to run it with:
    java -classpath /dir1/subdir1 /dir1/subdir1/Test
    I get a java.lang.NoClassDefFoundError: \dir1\subdir1\Test
    Any thoughts?

    You need to specify just the name of the class you want to run. So java -classpath /dir1/subdir1 Test

  • Running a java program outside eclipse...!

    Hi guys...!
    I wrote a java program that uses different classes. The program deals with xml documents and creates a new xml document. The problem is, the program works fine in eclipse, but when I run through the command line in windows, it complains that it can't see the different classes that I created. Here is one of the error messages:
    Test.java:44:cannont find symbol
    symbol : class Circuit
    location : class src.Test
    Circuit cir = new Circuit ();
    Note: Test.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details
    Does anyone know how to resolve this...?
    Any help from you guys will be very appreciated.
    Thanks..

    I think the problem is probably something like this:
    You have a path thus:
    C:\blahblahblah\With a subdirectory thus:
    C:\blahblahblah\srcIn which you have declared classes thus:
    package src;
    public class Foo {
    }And you have then used a classpath something like the
    following:
    javac -classpath C:\blahblahblah\src Foo.javaThis is incorrect. Your classpath needs to point to
    the root of the package hierarchy. If it's like the
    above, it will look in C:\blahblahblah\src for a
    package src, which results in a path like
    C:\blahblahblah\src\src which does not exist.
    You should set it to:
    C:\blahblahblah\Where that is the root from which your packages
    stem.
    Dave.Thanks Dave. It works man. I really appreciate your help.

  • Running a Java Program for every shut down of system

    Hi
    I have a java program that sends an email to the Admin of my network.
    But this is program i just want to execute for every shutdown and on of my system
    Please Tell me how to execute my java program at system shutdown time and on time..
    Thanks

    Despite your objective, this is not a Java issue. The real question is "How does one run a program just before system shutdown?"
    How you execute such an application is system dependent. Java doesn't know when the system shuts down, only when the JVM shuts down. Unless you're willing to have JVM running the entire time the system is up, you'll need native code to detect system shutdown & launch the notification app.

Maybe you are looking for

  • I can't get my contacts from email, I keep getting Personas Plus popup. What do I do?

    Shortly after I last updated firefox, I noticed several things that were different. One, my tabs are now above the URL line. I want them under all the rows on top. I also get alerts that I can't see because when I run over it with the mouse it come d

  • (Mid-2009 MacBook Pro) Black screen on windows 7 disk boot up

    Just tried to boot up from a windows 7 install disk, but I just got a black screen. Nothing else happened. Tried using an xp and vista disk also, but they both produced the same results. I've installed windows plenty of times from this computer befor

  • Profile issue in export workflow when PS is editor but not within Ap

    Aperture is with me on my MBP (with Elements as the external editor). My place of work is not graphics related, so it doesn't have Ap but does have PS CS8, which I've used happily for a long time, for their needs and I can use it for mine as well. So

  • Flash CS3 - saving as mx2004??

    Hi all Is there a way of getting Flash CS3 Pro to save as MX2004? I work at a school and the pc system is only at mx2004 but the mac I work on has cs3 installed. I've done a tutorial movie for the students but they need to be able to open and take ap

  • How to use goto function?

    how to use goto function in indesign javascript?? my script starts with chekcing whether input files are present or not.. if any of the input files r not present, i want to skip the function n terminate the functioning with displaying the message tht