|
FTP an uploaded file This script retrieves the data of a file sent to Hop via an html upload form and saves it on the server machine using FTP. var upload = req.data.myUpload;
if (upload) {
res.write("Error: " + req.data.uploadError + "<br>");
res.write("Content-type: " + upload.contentType);
var ftp = new FtpClient("remotehost");
ftp.login("user", "pass");
ftp.binary();
ftp.putString(upload.getContent(), "file.gif");
ftp.logout();
}
A corresponding html form might look like this:
<form name="uploadForm" enctype=multipart/form-data method="post"> File to upload: <input type="file" name="myUpload"> <input type="submit" value="1"> </form>
... comment
|
navigation
Download
Community
Weblog
Mailing Lists
IRC Channel
Documentation
Introductions
Tools
Reference
Project
Roadmap
Bug Reporting
Source
Wiki
Tags
Updates
Related Projects
search
|
||||