Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2004
    Posts
    313

    is this possible?

    Would I beable to copy a file from a local machine and send it to a ftp server?

    If this can be done can anyone please point me in the right direction

    Thanks

  2. #2
    Join Date
    Jun 2002
    Location
    Southeast USA
    Posts
    1,804
    Check out the FTP Plugin for AMS 5. You need the Pro version, but it's pretty easily implemented.
    Eric Darling
    eThree Media
    http://www.ethreemedia.com

  3. #3
    Join Date
    Jul 2004
    Posts
    313
    I have already purchased the FTP Plugin but was wondering if it was possible to send a file to a FTP server without any prompt.

    My project is a questionaire which records button clicks and stores the result in a .txt file. at the end of the questionaire the user will be shown the results from the .txt file but I would also like to send the file to a server for administration viewing.

    Can anyone here help me achieve this?
    Thanks.

  4. #4
    Join Date
    Jun 2000
    Location
    England
    Posts
    200
    Check out the FTP example, that came with the Plugin.

    I suggest you would need :

    FTP.Connect(strHostname, strUsername, strPassword);
    and a
    FTP.Upload(strSourceFile, strDestFile);
    at a minimum, but just pick out the bits you need from the example.

    I guess you would need to append some sort of unique identifier to the file names to avoid overwrites.

    J

  5. #5
    Join Date
    Jul 2004
    Posts
    313
    Thanks for that.

    I will have a look.

  6. #6
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Well the FTP pluin is definitely the best way to do this. You can do it without any system prompts, but the user's firewall is probably going to prompt them for access permission. That is going to be the same no matter which method you use. You can submit files via http using a simple upload form, but not without prompting the user. File fields in HTTP forms cannot be auto-filled because of a built in security feature. (in Javascript I assume)

    That all being said. Be aware, Windows has a built in FTP client. You can use it manually by going to START > RUN typing in "FTP", then press enter. You can use this FTP client to connect, upload, download, disconnect, etc. You can do this without prompting the user by containing your FTP commands in a simple text script and then referring to that script via a batch file. Tons of stuff on Google about this method, it's very easy to do. ***BUT NOT SECURE***. Your password data will be readily visible to the end user. You can protect it somewhat, you can even compile your batch file, but at the end of the day, the FTP script is plain text and, whether or not you write/delete it dynamically or have it static, the connection data is exposed at some point in the chain. Also, with the FTP client you can run it minimized but if your end user catches site of that minimized console window somehow, they are not likely to feel very secure about your software. Typical computer users will blanch pure white if they see a console window suddenly pop up and disappear.

    So, that's why I reccomend the FTP plugin. It's the quickest, easiest, cleanest way to do this. Can't beat it. It's not SS2 though, so it's not 100% secure either, but it's much, much more secure than a batch file...

    Hope that shines some light on the topic for you.

    Corey Milner
    Creative Director, Indigo Rose Software

  7. #7
    Join Date
    Jul 2004
    Posts
    313

    Huh?

    yeah it does thanks Corey.

    I didn't think about firewalls and things.
    I suppose I can have the user decide whether to send the info or not via a button.

    I have tried to use this code on the onshow event but then my AMS Projects closes.
    Any ideas why?

    FTP.Connect("ftp.mysite.com", "myusername", "mypassword", "", true);
    result = FTP.IsConnected();
    FTP.SetTransferType(FTP.AUTO);
    FTP.Upload("C:\\myfile.txt", "myfile.txt", nil);

    Hope you can help

    Thanks.

  8. #8
    Join Date
    Jul 2004
    Posts
    313
    Corey do you have any information on sending it to a email address?

    I suppose it doesn't matter how they get it as long as they do.

    I have read a few posts on sending attatchments but I have not yet grasped it.

    If you could point me in the right direction i would very much appreciate it.

    thanks

    Ian

  9. #9
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. Seems like the result = FTP.IsConnected(); isn't being used, so it's unneeded. I'm no expert on the FTP plug, Lorne or Mark are more up on that, but I think it might be because you need to set the remote directory, i.e.:

    FTP.ChangeDir("/var/www/html");

    Or whatever your "path to upload directory" is.

    One more idea is email, if it's just a little text, that would work. Or, and this is probably the ultimate solution, simply pass the text value to a PHP script and enter it in a MySQL database. If I were doing this, I think that's how I would do it. So:

    1. As the test finishes, an HTTP submit action sends the text to the server. You can use encrypted password access here if you like, or not.

    2. A tiny remote script inserts that text data into a remote (MySQL in my case) database.

    If you need a PHP/MySQL equipped host, http://www.tera-byte.com has hosting accounts for $9 per month which have full PHP/MySQL, tons of storage space and bandwidth, and a zillion other bells and whistles. The Tera-byte 4U account is da bomb. You can prepay the year for under $100.

    Corey Milner
    Creative Director, Indigo Rose Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts