Current location: Hot Scripts Forums » Programming Languages » PHP » Modifying this to upload via FTP


Modifying this to upload via FTP

Reply
  #1 (permalink)  
Old 12-22-05, 12:32 PM
recedo recedo is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Modifying this to upload via FTP

Hi,

I recently purchased an application I found via HotScripts; http://tools4php.com/form-wizard/index.html this application creates a php script to process html forms.

I want to use this for users to upload mp3 files to my server, it has a feature for uploading files which seems to work fine. However, I have been reading some articles which say that there may be issues uploading large files through php alone, using up all the memory etc etc.

The files I want users to upload are between 5-10MB each and they will be uploading 1-10 with each form submission.

Do you think the upload function would be quite easy to modify to upload via FTP. Below is all of the code that I think is used to process the upload;

PHP Code:

// Receiving variables

@$base_path addslashes($_POST['base_path']);
@
$r_Name addslashes($_POST['r_Name']);
@
$Company-Name addslashes($_POST['Company-Name']);
@
$re_eMail addslashes($_POST['re_eMail']);
@
$User-File_Name $_FILES['User-File']['name'];
@
$User-File_Size $_FILES['User-File']['size'];
@
$User-File_Temp $_FILES['User-File']['tmp_name'];
@
$User-File_Mime_Type $_FILES['User-File']['type'];

function 
RecursiveMkdir($path)
 {
   if (!
file_exists($path)) 
   { 
      
RecursiveMkdir(dirname($path));
      
mkdir($path0777);
    }
  }


// Validation
if( $User-File_Size == 0)
{
die(
"<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid user-file</font></p>");
}
if( 
$User-File_Size >10000000)
{
//delete file 
unlink($User-File_Temp);
die(
"<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid user-file</font></p>");
}
if( 
$User-File_Mime_Type != "audio/mpeg" )
{
unlink($User-File_Temp);
die(
"<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid user-file</font></p>");
}
$uploadFile "uploads/".$User-File_Name ;
if (!
is_dir(dirname($uploadFile)))
  {
    @
RecursiveMkdir(dirname($uploadFile)); 
  }
else
  {
  @
chmod(dirname($uploadFile), 0777);
  }
@
move_uploaded_file$User-File_Temp $uploadFile); 
chmod($uploadFile0644);
$User-File_URL "http://www.site.com/uploads/".$User-File_Name 
Any help would be appreciated.

I'm also interested in a method to show some sort of progress bar, or psuedo 'uploading' animation so users know that somethings going on in the background.

TIA
Simon
Reply With Quote
  #2 (permalink)  
Old 12-22-05, 12:50 PM
recedo recedo is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
I found some ftp uploading script here;

http://px.sklar.com/code.html/id=1054

Perhaps this could be used.

By the way... I am not a PHP programmer, I only know a few basics, not enough to do this by myself with no help!

Simon
Reply With Quote
  #3 (permalink)  
Old 01-08-06, 01:57 PM
javazoom javazoom is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
You could also try an applet. jClientUpload allows both HTTP and FTP upload.
http://www.javazoom.net/applets/jcli...entupload.html
It could work with server-side PHP technology.

Hope it helps.
Reply With Quote
  #4 (permalink)  
Old 01-08-06, 02:04 PM
recedo recedo is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Yeah, I already have your applet. The only problem is the code signing, I can't afford to buy a certificate!

I have been looking at http://upload.thinfile.com who sell their applet with a valid certificate, and you can download upgrades for 2 years (so when the certificate is replaced you can update). However, their software doesn't have as many features as yours, in particular renaming and deleting partial uploads, also as yours takes the url from the calling page I can customise it to go to the current users folder (Thin ftp upload has it in the config file which makes it hard!).

Anyway, I'm still seeing what I can do.
Simon
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload Applet (HTTP and FTP) javazoom General Advertisements 0 11-12-05 04:45 AM
ASP upload prob minority ASP 1 06-27-05 08:35 AM
FTP File Upload Script - Help me Please glennlopez Script Requests 4 06-01-05 05:16 AM
PHP upload images without FTP? AlexLee PHP 3 12-25-04 12:41 AM
move files around an ftp server, with php file upload script? wapchimp PHP 2 12-19-04 07:27 AM


All times are GMT -5. The time now is 06:23 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.