Zubrag.com
November 13, 2019, 09:57:27 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: php - downloading images from different folders by  (Read 2681 times)
thomas mugo
Newbie
*
Posts: 1


« on: May 10, 2010, 05:47:26 AM »

Hello.

I have been uploading pdf images in a folder path    ../web/upload.  Currently, this folder has
over 140,000 images of  51GB. I want to stop saving images in this ../web/upload folder.

My system generate a new folder every new month
           i.e. ../web/upload/files2010-04 (for April), ../web/upload/files2010-05 (for may) etc.

This works BUT to download the images from the subfolders inside the subfolders takes a very long time.
 i.e. download images from ../web/upload folder ......takes 1-2 second
                              from ../web/upload/files-04 ....takes <=10 minutes.

What I want.
------------
1. to modify download.php such that it is able to search for files BOTH IN ../WEB/UPLOAD and ../WEB/UPLOAD2

Thank you.

Attached -download.php file in zip.

T Mugo

Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #1 on: May 12, 2010, 04:36:55 AM »

I think following will work.

define('BASE_DIR', $vDirName );  should point to fast working folder

than find this code
if (!is_file($file_path)) {
    die("File does not exist. Make sure you specified correct file name.");
}

and add this code before it
if (!is_file($file_path)) {
  find_file('/PATH/TO/SECOND/FOLDER/', $fname, $file_path);
}
if (!is_file($file_path)) {
    die("File does not exist. Make sure you specified correct file name.");
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC