5, September 2008

easy upload and download need help! - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: easy upload and download need help!
« previous next »
Pages: [1] 2 Print

Author Topic: easy upload and download need help!  (Read 2361 times)
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« on: Apr 20, 2007, 06:09:30 AM »

ive downloaded easy upload php, ive confgured the mulitple file upload php to my needs. im a newbie. i wanted my easy upload to look the same as it was together with the drop down menu directory. can someone help me
« Last Edit: Apr 20, 2007, 01:32:31 PM by Olaf »
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 884
1636 credits
Members referred : 4



Re: easy upload dilema
« Reply #1 on: Apr 20, 2007, 08:26:40 AM »

you aren't really stating what your problem is, we wont be able to help unless you give a better description and maybe some code snippets

Visit through proxy Visit through proxy Visit through proxy

Last blog : phpHaze 1.59.1 in Development
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Apr 20, 2007, 08:38:42 AM »

ive downloaded easy upload php, ive confgured the mulitple file upload php to my needs. im a newbie. i wanted my easy upload to look the same as it was together with the drop down menu directory. can someone help me
Hi,

this drop down is not part of the upload class, its a combination several scripts, check here: Visit through proxy

@Method, if you know the scripts its much mire clear too answer Wink


Last blog : Is your website is down? Know before your visitors do!
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #3 on: Apr 20, 2007, 10:22:41 AM »

hehehe sorry i think thats the problem with newbies they tend to talk and talk without stating the facts. sorry. the problem, ive downloaded easy php upload at php scripts and classes. i like its appearance in the demo script (the upload function and download functions). what im trying to get at is use the download function in my own site too. the link to php.net doesnt point to such script. and additional, the scirpt i used for the easy php upload demo is the multiple file upload. how can i make my upload & download site look exactly in the php scripts and classes site. "UPLOAD FUNCTION AND DOWNLOAD FUNCTION" visible in my page. hope this is clear i pray  Smiley thanks and more power
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Apr 20, 2007, 10:32:19 AM »

hehehe sorry i think thats the problem with newbies they tend to talk and talk without stating the facts. sorry. the problem, ive downloaded easy php upload at php scripts and classes. i like its appearance in the demo script (the upload function and download functions). what im trying to get at is use the download function in my own site too. the link to php.net doesnt point to such script. and additional, the scirpt i used for the easy php upload demo is the multiple file upload. how can i make my upload & download site look exactly in the php scripts and classes site. "UPLOAD FUNCTION AND DOWNLOAD FUNCTION" visible in my page. hope this is clear i pray  Smiley thanks and more power

as I posted in the other thread, its a combination of 3 scripts, because of security reasons I can't show you the code from my demopage


Last blog : Is your website is down? Know before your visitors do!
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #5 on: Apr 20, 2007, 10:36:55 AM »

Maybe you can email it to me. kimusabe007@yahoo.com, i really love to use the script on my page. or you can teach me pls. thanks
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #6 on: Apr 20, 2007, 10:52:10 AM »

what do you mean "combination"? of a class and 3 sniplets? what ive done so far is created a .php page and <? include upload_example.php on it. It appeared well and i been able to upload files. the problem is i also wanted the download function and open directory function to appear on the .php ive created.   Smiley thanks
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Apr 20, 2007, 10:59:52 AM »

Do you have any PHP knowledge?

maybe you need to try some beginners tutorial first


Last blog : Is your website is down? Know before your visitors do!
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #8 on: Apr 20, 2007, 11:31:35 AM »

im really a newbie im really sorry for annoying you. i really wanted to explore this script for my page to look good but it seems that your holding back in helping me. ill just have to play around with it anyway. dont know any php thats why i seeking help in this forum. thanks and more power Smiley
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Apr 20, 2007, 12:19:03 PM »

im really a newbie im really sorry for annoying you. i really wanted to explore this script for my page to look good but it seems that your holding back in helping me. ill just have to play around with it anyway. dont know any php thats why i seeking help in this forum. thanks and more power Smiley
helping people doesn't mean give everything for free what someone has asked (next time you will ask me for a copy of my website Smiley), you got my script (for free) and you didn't showed me the code where you have a problem. If you can show me the code I will try to locate the problem.

DON'T POST the code I have already provided, but it's not a shame PHP web development is a profession (same like web design), you can't lean that by downloading a script...


Last blog : Is your website is down? Know before your visitors do!
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #10 on: Apr 20, 2007, 12:34:16 PM »

 Grin no that is not the case i really appreciate the code you have provided for free. the easy upload php doesnt have a problem for me, and its been working perfectly in my site. all i want is the download and open directory function which i saw in your script demo page. honestly i dont know where to start? Embarrassed no errors in the scipt thank again for your patience
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #11 on: Apr 20, 2007, 01:31:23 PM »

Grin no that is not the case i really appreciate the code you have provided for free. the easy upload php doesnt have a problem for me, and its been working perfectly in my site. all i want is the download and open directory function which i saw in your script demo page. honestly i dont know where to start? Embarrassed no errors in the scipt thank again for your patience

start with the open directory function to get the select working


Last blog : Is your website is down? Know before your visitors do!
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #12 on: Apr 23, 2007, 04:15:14 AM »

ok ive put the open directory code in my site... but its blank on my web browser Cry
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #13 on: Apr 23, 2007, 10:25:53 AM »

ok ive put the open directory code in my site... but its blank on my web browser Cry
enable error reporting...


Last blog : Is your website is down? Know before your visitors do!
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #14 on: Apr 23, 2007, 11:43:52 AM »

where is that? here is the code: download.php

<?php
function select_files($dir, $label = "", $select_name, $curr_val = "", $char_length = 30) {
    $teller = 0;
    if ($handle = opendir($dir)) {
        $mydir = ($label != "") ? "<label for=\"".$select_name."\">".$label."</label>\n" : "";
        $mydir .= "<select name=\"".$select_name."\">\n";
        $curr_val = (isset($_REQUEST[$select_name])) ? $_REQUEST[$select_name] : $curr_val;
        $mydir .= ($curr_val == "") ? "  <option value=\"\" selected>...\n" : "<option value=\"\">...\n";
        while (false !== ($file = readdir($handle))) {
            $files[] = $file;
        }
        closedir($handle);
        sort($files);
        foreach ($files as $val) {
            if (is_file($dir.$val)) { // show only real files (ver. 1.01)
                $mydir .= "    <option value=\"".$val."\"";
                $mydir .= ($val == $curr_val) ? " selected>" : ">";
                $mydir .= (strlen($val) > $char_length) ? substr($val, 0, $char_length)."...\n" : $val."\n";
                $teller++;   
            }
        }
        $mydir .= "</select>";
    }
    if ($teller == 0) {
        $mydir = "No files!";
    } else {
        return $mydir;
    }
}

// example: echo select_files("path_to_your_folder");
?>

then on my directory.php file i put this <? include("home/download.php");?> thanks

the main file which adapts to my site is directory.php, within directory.php is the <? include statement which points to download.php. im i on the right track?
« Last Edit: Apr 23, 2007, 11:50:09 AM by andoy »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #15 on: Apr 23, 2007, 12:45:52 PM »

remove this to see a result

// example:


Last blog : Is your website is down? Know before your visitors do!
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #16 on: Apr 24, 2007, 03:03:51 AM »

done! removed it. this is the error:

Warning: Missing argument 3 for select_files() in /var/www/html/upload_class/directory.php on line 3

Warning: OpenDir: No such file or directory (errno 2) in /var/www/html/upload_class/directory.php on line 5
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #17 on: Apr 24, 2007, 03:21:24 AM »

error 2 is gone i have the directory and drop down box visible now. Grin
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #18 on: Apr 24, 2007, 08:13:26 AM »

error 2 is gone i have the directory and drop down box visible now. Grin

ok then next you need somthing like

Code:
<?php
if (!empty($_REQUEST['selectfoldername'])) {
$path $_SERVER['DOCUMENT_ROOT']."/path2file/"// play with the path if the document root does noet exist
$fullPath $path.$_GET['selectfoldername'];

if (
$fd fopen ($fullPath"r")) {
    
$fsize filesize($fullPath);
    
$path_parts pathinfo($fullPath);
    
$ext strtolower($path_parts["extension"]);
    switch (
$ext) {
        case 
"pdf":
        
header("Content-type: application/pdf"); // add here more headers for diff. extensions
        
header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use 'attachement' to force a download
        
break;
        default;
        
header("Content-type: application/octet-stream");
        
header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
    }
    
header("Content-length: $fsize");
    
header("Cache-control: private"); //use this to open files directly
    
while(!feof($fd)) {
        
$buffer fread($fd2048);
        echo 
$buffer;
    }
}
fclose ($fd);
exit;
}

this code should be before any html code and you need to change some variables


Last blog : Is your website is down? Know before your visitors do!
Metal slug addict
*
Posts: 19
118 credits
Members referred : 0


« Reply #19 on: Apr 24, 2007, 09:52:55 AM »

done! but its a blank page. ive named it ex.php. ive change the path2file to my needs but its blank
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6415
Tags : easy upload php Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] 2 Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: easy upload and download need help!
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 05, 2008, 07:22:48 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.294
Total Topics: 7.477
Total Members: 3.899
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: speedy5044

27 Guests, 4 Users online :

14 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.