If it were up to me, I'd start back at the beginning and reevaluate what you want to accomplish and see if there is an easier way.
If it were up to me, I'd start back at the beginning and reevaluate what you want to accomplish and see if there is an easier way.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Try having a look at this.
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
Thanks! I finally had a bit of time to look at that.
This code is working for jpeg and exe and those sorts of things:
But it won't do ANYTHING for mp3 or video files. . . My guess is that PHP finds them too large. What can I do to fix this now? (As I said, everything else seems to be working.)Code:<?php if(isset($_POST['submit'])){ set_time_limit(0); $ftp_server='localhost'; $conn_id = ftp_connect($ftp_server); $myFile = $_FILES['source_file']; $source_file = $myFile['tmp_name']; // login with username and password $user=""; $passwd="" $login_result = ftp_login($conn_id, $user, $passwd); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; die; } else { echo "<br>Connected to $ftp_server, for user $user<br>"; } ftp_chdir($conn_id, "/information/"); ftp_chdir($conn_id, "uploads"); echo $_FILES['source_file']['name']; $destination_file= $_FILES['source_file']['name']; echo ("<br>"); print $destination_file; echo ("<br>"); // upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } // close the FTP stream ftp_close($conn_id); } ?> <!--===========================================================//--> <html> <body marginwidth=4 marginheight=4 topmargin=4 leftmargin=4 bgcolor=white vlink="#0000ff" link="#0000ff"> <form name="Attachments" method=POST action="upload.php" enctype="multipart/form-data"> <input type=hidden name=box value=""> <td nowrap width="1%"> <b>Image:</b></td> <input type=file name=source_file size=20> <br> <input type="hidden" name="MAX_FILE_SIZE" value="9999999" /> <input type=submit name=submit value=submit size=20 style="border: 1px solid #0000FF"></form> </body> </html>
Thanks for your help so far. I am SOOOOOOO close to being done with this mess.
Last edited by Jas; 10-23-2007 at 08:13 PM.
--Jas
function GreatMinds(){ return "Think Like Jas"; }
Okay, so I googled for what seemed an eternity, fiddled with tons of ". . . Do this here and put that there and type this bit of code here. . . " *Sigh* I added php_value upload_max_filesize 160M to htaccess file. It still doesn't work with videos.
BUT!!!!
It IS working with MP3's! Soooooooooo cloooooose! Anything else that I can do to push this over the edge? I will keep fiddling, but I can't get the darn videos to upload. I am in a much better mood now though.![]()
--Jas
function GreatMinds(){ return "Think Like Jas"; }
Is the issue filesize or file type? If it's type, then the problem is either restricted file types on the server (unlikely) or something quite easy to fix in the script.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
I AM SO HAPPY!!!!
![]()
The script WORKS!!!
I uploaded the first vid just a minuet ago.
I'll post a final draft of it later for anyone who wants to use something like it-- no one deserves to go through that trying to write a script! At any rate, where should I post it when I am done (so that people can find it)?
Thanks everyone who put up with me throughout this -- I know I annoyed everyone, but hopefully now there will be no more FTP questions (from me anyway).
--Jas
function GreatMinds(){ return "Think Like Jas"; }
And how do you all feel about the uploading of EXE files? How safe are they and how can I make them . . . safer? I want to have this capability on my site, but I am worried about some nut uploading something to destory my server/computer. (As far as I know an EXE can't execute itself, but I am not really sure about that).
EDIT: Come to think of it, how can I make sure that it is safe for the user to download it?
--Jas
function GreatMinds(){ return "Think Like Jas"; }
actually i think it would be bad, and you shouldn't use it, edit your mime(?) types and make it so it allows you to download them instead of on command url.. I think its possible through html and a major hacker would fool with it...
is mime right your ext??'s
Hey new design new look, goto xudas for personal webdsign help..(:
Er, I have no idea what you just said lol. I got the bad idea part, but after that I am a little lost. . .
--Jas
function GreatMinds(){ return "Think Like Jas"; }
oops im sorry that is confuzing...
do you want users to automatically download the .exe file? if so I think you can you should make it so where it downloads the files instead of it going into the browser, im not really sure though...
eek im sorry im really confuzing person...lol
Hey new design new look, goto xudas for personal webdsign help..(:
Bookmarks