PHP Simplicity Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Guest posting is allowed. Again!

Author Topic: download.php  (Read 5216 times)

0 Members and 1 Guest are viewing this topic.

Lou

  • Guest
download.php
« on: February 07, 2005, 05:39:46 AM »

Hi, I know you are back at uni but hopefully you can help me!

I have everything working perfectly but I have a seperate directory for the uploaded files to go to, so I need these files to show in the download.php table, I have changed the file path but the table still only shows all the php files.  I used a path.php script to make sure the path was correct (to the upload folder).
Is there anything else I need to change,

many thanks

Lou ;)
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: download.php
« Reply #1 on: February 08, 2005, 07:14:00 AM »

can you tell me where is the files being uploaded and where download.php is?
however, in download() function you can use a relative path!
say your uploaded files are in SubFolder just under documents root:
- ROOT/SubFolder/

and you have your download in ROOT then in download() function pass the first argument as:
download('./SubFolder',  true);

HTH :)
Logged

We don't need a reason to help people

Guest

  • Guest
Re: download.php
« Reply #2 on: June 05, 2005, 03:29:24 PM »

Where do we put this argument? I'm having the same problem, my PHP isn't up to speed yet :(
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: download.php
« Reply #3 on: June 06, 2005, 07:16:58 AM »

put it in the first argument of Download() function!
open download.php and look for:
Downloads('.'truetrue);
replace it with:
Downloads('/path/to/upload/'truetrue);
Logged

We don't need a reason to help people

Guest

  • Guest
Re: download.php
« Reply #4 on: June 07, 2005, 06:30:48 PM »

I've changed the argument to:

Downloads('/useruploads/', true, true);

but it still doesn't work. I've tried tinkering around in functions.php and I can get the files to display and download but the stats don't display properly. Is there something else that has to be changed in functions.php to complement the change in download.php?
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: download.php
« Reply #5 on: June 08, 2005, 05:06:04 AM »

other than the definintion of download funcion, no!
note that /useruploads/ is real path! you may want to have 'useruploads/' instead or just 'useruploads'..
anyway, what do you mean by not displaying proparly? what do you see?
Logged

We don't need a reason to help people

Guest

  • Guest
Re: download.php
« Reply #6 on: June 09, 2005, 12:04:42 AM »

I get all the file listings but every file size and date is the same. Example:

sst-lyrics.zip     0 KB     31-12-1969 19:00:00
01 - Be Your Girl.mp3    0 KB    31-12-1969 19:00:00
13 - Ready Steady Go!.mp3    0 KB    31-12-1969 19:00:00
Logged

Jordan

  • Guest
Re: download.php
« Reply #7 on: June 17, 2005, 03:41:11 PM »

Yes, I came across the same problem.  I noticed that the download.php page uses the correct directory to list the files.  However the functions.php download function does not use the same directory.  It always uses the location the page is in, not the specified directory.  Thus giving an error when trying to display stats and create the links. 

In the image below you can see the script is in the "uploader" directory and the file "EDI_Logo" is in a sub directory "uploader/uploads". It finds the correct directory to list the files, however when it tries to run stat() it is looking in the wrong directory "uploader".

I'm not good at programming, so if someone else can take a look at this and come up with a solution, that would be great.

Other than that, the script is great. Thanks for releasing it.

Logged

TuXi

  • Guest
Re: download.php
« Reply #8 on: June 17, 2005, 10:19:03 PM »

First i got to say this script is really nice!! I like it a lot, already. But i've got the same problem when i tried this thing... To put: Downloads('uploaded/', true, true);  in the download.php

I don't know if i and the other guys want to do the same thing, show the files that are uploaded on the upload-page.
It was a step forward when i got the download.php to show the files in my uploaded directory, but it's a little problem there, as you see in the post before.

But, is there an easy way of showing the uploaded files on the server, on the upload page? Maybe it's just to Include the download.php in the upload.php?

Sorry for my bad english, i'm Swedish and really tired!!  :P

thanks!
Logged

DarkRaver

  • Guest
Re: download.php
« Reply #9 on: December 20, 2005, 02:51:17 PM »

Hello, i have this problem to, i succesfully changed the upload and download directory, it reads the files but not the information:

        $info  = stat('uploads/');
        $stat1 = round($info['size'] / 1024, 2);
        $stat2 = date('j-n-Y H:i:s', $info['mtime']);

It will show all files with same date, and all sizes 4kb, please help with this problem to solve, for the rest the script work great.

PS: Test area = http://www.darkraver.net/downloads/up_files/  ;)
Logged
 

+ Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.
Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What is the answer to one plus one? (in numbers):