this script runs off your server not ftp.. you don't have to have ftp to upload images or whatever, any more questions let me know...
Printable View
this script runs off your server not ftp.. you don't have to have ftp to upload images or whatever, any more questions let me know...
Videos, however, really need FTP. When I try to upload mpeg videos (or any other type for that matter), the server kills over, if you know what I mean. So, I am really looking for a FTP version right now. (Your right, though, about pics. That type of transfer is perfect for image files or text files.)
oh.. I see what you mean, you have to talk to your hosting company becuase they only allow uploads of up to I think 8mb or 4mb, first try uploading like a mpeg or whatever that is like 4mb and see if it works..
I will be running the server (hosting companies annoy me too much, and I should have the resources to host everything myself). The problem is that the vids are just going to be to big. The type of videos that are going to be on this site are instructional, which means they could very well be 30min long. I know that you can change the settings to allow bigger files and what-not, but at some point you just have to switch to FTP.
ftp is for uploading files to a server I don't know if there is a such thing as a program that does this, but..
if you have your own server and you have php installed on it, then your going to have to look on the web, and find out how you can change the settings to allow uploads from like 8mb to higher,
but, I don't really know what to do, so I hope you figure it out..
What I am really looking for is someone to correct the script at the beginning of this thread. . . It is somewhat functional, but it doesn't insert the data from the uploaded to the stored file.
EDIT: I found this script:
But what is this:Code:<?php
// get FTP access parameters
$host = $_POST['host'];
$user = $_POST['user'];
$pass = $_POST['pass'];
$destDir = $_POST['dir'];
$workDir = "/usr/local/temp"; // define this as per local system
// get temporary file name for the uploaded file
$tmpName = basename($_FILES['file']['tmp_name']);
// copy uploaded file into current directory
move_uploaded_file($_FILES['file']['tmp_name'], $workDir."/".$tmpName)
or die("Cannot move uploaded file to working directory");
// open connection
$conn = ftp_connect($host) or die ("Cannot initiate connection to
host");
// send access parameters
ftp_login($conn, $user, $pass) or die("Cannot login");
// perform file upload
$upload = ftp_put($conn, $destDir."/".$_FILES['file']['name'],
$workDir."/".$tmpName, FTP_BINARY);
// check upload status
// display message
if (!$upload) {
echo "Cannot upload";
} else {
echo "Upload complete";
}
// close the FTP stream
ftp_close($conn);
// delete local copy of uploaded file
unlink($workDir."/".$tmpName) or die("Cannot delete uploaded
file from working directory -- manual deletion recommended");
?>
$workDir = "/usr/local/temp"; // define this as per local system
I can't figure out what it should be.
Can anyone help here?
I am really getting tired of google-ing for this, so if you guys can help I would be INSANELY grateful:
Could someone please post an FTP video upload script (that uses an HTML form). It doesn't have to be fancy, it just has to work. I have been trying and trying for months. . . :confused: :mad: :confused: :mad: I don't mean to be so annoying on FTP, but this is the last major step in the project that I am working on (still a long way to go on my site, but nothing major after this).
Thanks guys.
No one knows what it is either, huh? :) I've been trying various paths, but can figure out what it wants. . .
Don't post two threads on the same subject.
If your host does not allow large uploads, that won't change, no matter what you do after the file is uploaded.
A file field in a form means that the file is sent onto the server to a temporary directory, found by tmp_name. That's the whole idea. Then it is moved by move_uploaded_file, and you can place it where you want.
If the host doesn't allow large files, it doesn't matter if you move it, use FTP to place a second instance of itself onto the same host (a complete waste of time/work), or just delete the file-- it won't work.
If FTP really does allow larger files (and it isn't just the browsers timing out, which is common on large files), then you would need to give everyone access to your FTP account.
A few ideas for workarounds:
1. Use a second server and use an FTP upload, but that seems roundabout, and if you have the second server that does work, what's the point?
2. Use another way to upload the file, like a Java applet, which might be nice for such a large file as it could give the user more info about speed, etc., while uploading.