Visit The New, Modern Unix Linux Community


Uploading a file in ftp by culr?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Uploading a file in ftp by culr?
# 1  
Question Uploading a file in ftp by culr?

I have ftp url, username and passwd.
My file is named app.log.
How do I upload this to my ftp server???

I read the manual but I didn't understand much...Smilie
# 2  
It's pretty simple, actually. The basic structure is
Code:
curl <option> <URI>

with the URI being a combination of protocol, user, password, server, port, and path. The option you're looking for is -T. So the command line would be
Code:
curl -T /local/path/file ftp://<user>:<pass>@<server>/remote/path

or
Code:
curl -u <user> -T /local/path/file ftp://<server>/remote/path

if you want curl to ask for the password.
# 3  
PHP

Thank you for the information. I noticed that the password "lefts" the PC as plain text, and a sniffer (like wireshark) can easily capture it and thief it. So anyone can have my passwd. Is there any option to make the passwd encrypted or something?
# 4  
This is a limitation of ftp. If the remote host has sshd running on it, you can use sftp or scp instead:

Code:
scp /path/to/local-file user@remote-host:/path/to/destination

# 5  
Or, in addition to Coronas suggestion, some servers support FTPS (FTP + SSL)

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #832
Difficulty: Medium
JSON is a data serialization format.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Simple Shellscript for uploading files to a specific folder on a ftp-server?

hi! Iam using my D-link DNS-320 (NAS) with fun_plug installed (a unix client) I am currently using cron to run a shellscript running a java-application that creates a couple of txt files. These files needs to be uploaded to a specific folder on my webhosts ftp server-account. I need a... (16 Replies)
Discussion started by: Nigge
16 Replies

2. UNIX for Advanced & Expert Users

SFTP Resticting Only Uploading Of A File

I have setup our SFTP server: SFTP Setup: /etc/ssh/sshd_config: Subsystem sftp internal-sftp Match Group sftpusers PasswordAuthentication yes ChrootDirectory /srv/sftponly AllowTCPForwarding no X11Forwarding no ForceCommand internal-sftp Adding the... (5 Replies)
Discussion started by: metallica1973
5 Replies

3. Shell Programming and Scripting

Perl , uploading empty file.

Hi The below script used to work fine. Suddenly it's uploading empty file. I am very new to perl. Please help me to find out the problem. #!/usr/bin/perl #script: upload.pl use CGI qw/:standard/; print header, start_html('File upload'); print_form(); print_results() if... (2 Replies)
Discussion started by: Anupam_Halder
2 Replies

4. Shell Programming and Scripting

Shell: uploading file from UNIX server to sharepoint server

Is it possible to upload a file from unix server to sharepoint server through shell or perl scripting. I have the sharepoint link where it needs to be uploaded. Could you please share your views on this ? (0 Replies)
Discussion started by: scriptscript
0 Replies

5. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

6. Shell Programming and Scripting

Issue in uploading file using sftp

Hi I'm using this script to upload a file from local system to sftp server. But in the log file i'm getting an error "Error during upload" Can you please help me out ... ### CONFIGURATION LOCAL_DIR=/abc/out FILE_MASK="File*.txt" LOG_DIR=/abc/error/File_`date "+%Y%m%d%H%M%S"`.LOG... (3 Replies)
Discussion started by: Jaychandra
3 Replies

7. Solaris

Issue With File Permissions while uploading

one of the business users is ftping files into unix box using user name ftp_user, where as i am using infa_user to login into same unix box. When i am trying to access those or copy over those files from upload directory it says permission denied. Though i know the password of ftp_user to... (4 Replies)
Discussion started by: Ariean
4 Replies

8. UNIX for Dummies Questions & Answers

Uploading a Directory via FTP in the Command Line

Hello, Is there a way to upload a directory via ftp in the command line in a single line? I'd be looking for something like this: ftp -username me -password 12345 /Users/me/mywebsitefolder /publichtml/ But I can't figure out the proper syntax. Thank you for any help. -Grey (1 Reply)
Discussion started by: wellington_grey
1 Replies

9. Shell Programming and Scripting

Simple script uploading *.dem files to an ftp

Hello.. i want to create a simple script that's upload all the *.dem files from one directory to ftp and then delete them. Any help? (3 Replies)
Discussion started by: TuXaKoS
3 Replies

10. Shell Programming and Scripting

Uploading a flat file into the database.

I want to upload a text file into the database. what is the command for that? Thanks in Advance. (1 Reply)
Discussion started by: Balkrishna
1 Replies

Featured Tech Videos