PHP Upload Module with Progress Meter and more..anyone up?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   PHP Upload Module with Progress Meter and more..anyone up?
djcronos
CZ Newbie
djcronos has been a member for over 19 year's 19 Year Member
Status: Offline
Joined: Jul 25, 2004
0.00 posts per day
Posts: 1
Points: 104
   
Hey folks,

I've been frantically beating my head against the table for the past 3 weeks trying to figure out a way to get what I need accomplished, and since I cannot grasp PHP as quick as I want to (I've been trying for well over a year, and I only know the basics, it just doesn't sink in for me). I run a large site that gets over 2,000 hits a day, and offers legal mp3 downloads of underground DJs and Producers. The site has a part where anyone can sign up for free, and once they are a member, they can upload a mix or track they've created.

I currently use Nukestyles Enhanced Downloads v2.1, and I think that module is just fantastic. There's a few things I wish would be better about it, mainly the uploads section. There's two main features that this upload script need to have, and I've done some research as to what's out there.

What I would essentially want from a PHP Upload script is the ability for it to use FTP commands, be able to resume uploading the file if a connection is lost, and be able to give some sort of progress meter, letting the user know how much (rough estimate) time they have left until the file is uploaded. And of course, once it is uploaded, the administrator has to approve of it before it gets added to the downloads database.

Since some of the files users upload are a MINIMUM of 80mb (yes, I have all my max_uploads_size, memory_limit, and all that other good stuff already set up to where I need them, including timeouts), having a resume capability is essential. I read some posts from Google, and parts of the PHP manual, and it looks like you can use FTP commands within PHP that support resume - nifty idea. There's one script I found that looks really neat that looks like it satisfies everything I am looking for. It uses FTP PHP commands, has somewhat of a Progress Meter, and it resumes. The only problem is that it relies heavily on PEAR, which some people don't have (including myself). I did some research and found I can put PEAR inside a directory in my directory and pull it up from there. That gets me past the first part, the second part is figuring out how to get the damned thing to work. You can find that PHP script at [ Register or login to view links on this board.] .

I also found JUpload, which is a Java-Based uploader that shows a real-time progress meter, how many kb/sec your're uploading at, but I'm not sure if it supports resume. It's a cool tool, but I gave up trying to incorporate this because a) some of the members of my site didn't have Java, and b) I couldn't get it to work by putting it inside PHP code - it would only work in an HTML file, which means I was doing something wrong.

There's also this upload progress meter I saw that looked really cool because it does Real Time progress in PHP, but you need to patch your PHP and edit some settings in your PHP.INI file that aren't configurable unless you have access to php.ini. That can be found at [ Register or login to view links on this board.] .

I've been frantically trying to get something like this to work inside the EDL for the past week, and since I am unable to comprehend PHP as well as I want to, I keep running into errors. I've tried incorporating JUpload, but then ran into the problem when I couldn't incorporate it properly into a PHP file, and incorporating it into an HTML file gives anyone access to upload files as they choose. I've also tried snagging some PHP scripts that didn't have a progress meter, but used PHP's internal FTP command to place them on the server (thus giving users the option of resume in case connection is lost, which I think is a great idea). I just can't seem to get it down, so now I (hopefully) turn to you folks.

I'm willing to get down to the bottom of this and release either one of these, if not both options to the EDL community (bathtub, a progress meter AND ftp resume do sound like a perfect combination), but I've run into a roadblock. Would any of you be willing to give me some extra information as to what I need to change inside the several documents in order to have this function properly? If it's simple PHP commands, couldn't I just incorporate these into the existing files as a function? Or would it be easier to create an entirely separate module?

So far, what I've done is copied the ns_upload_form($type) function, made it a new function of dju_uploads($type) and placed the form that is needed to upload the file inside of that, as well as changing the ns_upload($type) function at the bottom from ns_upload_form($type) to dju_uploads($type). I've also taken the ns_upload_file($type, $fileupload, $ns_directory) and put all the necessary PHP FTP upload commands in there, including server name, login, and password. No luck at all. What am I missing? Am I forgetting certain things I need to add?

Basically I'm stuck between a rock and a hard place, and am turning to you fellow coders for help. If any of you would like to help me out with this project, and show me what I'm doing wrong or what I should do instead (such as, if I were to create a new module entirely apart from editing the EDL v2.1, how would I go about that?), I would be eternally grateful.

I thank you all for reading this email, and hopefully someone is willing to help take on this task with me icon_smile.gif

Patrick



Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.05 posts per day
Posts: 8089
Points: 494,430
   
Use your html form inside of the php file.

<?php
require_once("mainfile.php");
include("header.php");
$variables
$sql_queries
if (is_user($user)) {
?>
<html>
Form
</html>
<?php
} //end is user
include("footer.php");
?>




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum