Zubrag.com
May 20, 2012, 11:24:15 pm *
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: on BASE_DIR  (Read 8832 times)
rdcode
Newbie
*
Posts: 3


« on: August 04, 2007, 07:57:44 pm »

Hi. I am a newbie trying to make Smart File Download software to work and have across a few problems despite having read the posts.
In trying to define BASE_DIR  I seem to be running out of options here. I included my domain name without the http://  within the BASE_DIR quotes as follows:

define(mydomain.com), (downloads/)

// log downloads?  true/false
define('LOG_DOWNLOADS',true);

// log file name
define('downloads','downloads.log');

None of this works. I chmd the downloads file to 777 as indicated in the instructions. I also tried putting download.php and download.log outside my download folder which I named download_file  and still not getting results. Despite the fact all these files were inside the downloads folder.  I was wondering if I should use my root server name instead of my domain name where BASE_DIR goes (such as home/user/... but that did not worked either. My public_html folder at my server is marked as <..> but not sure if I could mess something up by using the brakets within the BASE_DIR quotes. Is there anything you can suggest I do?.Thanks.

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


WWW
« Reply #1 on: August 06, 2007, 08:30:31 am »

Hi. You'll have to update text marked with bold font ONLY.

// Download folder, i.e. folder where you keep all files for download.
// MUST end with slash (i.e. "/" )
define('BASE_DIR','D:/www/zubrag/downloads/download/');

// log downloads?  true/false
define('LOG_DOWNLOADS',true);

// log file name
define('LOG_FILE','downloads.log');

Usually you do not have to update last two options (however it would be more secure to change downloads.log to something else).


But you'll definitely need to update the first option:
define('BASE_DIR','path from the root to the folder containing files for download');

If you save following as php file (ex: path.php) on your server in your downloads folder and open it in browser you'll see the path.

<?php

echo __FILE__;

?>

It will output something like /www/home/blahblah/downloads/path.php

Put that string into BASE_DIR statement (but remove "path.php" from that string). In our example it will be (note ending slash)
define('BASE_DIR','/www/home/blahblah/downloads/');
Logged
rdcode
Newbie
*
Posts: 3


« Reply #2 on: August 07, 2007, 01:07:15 am »

Thank you Zubrag, the script is working now. I had deleted the words BASE_DIR and typed my domain name in the space where (BASE_DIR) goes and that also set me back during installation. I am glad this got corrected and it is finally working. Thanks for helping.
Logged
flyfisher2
Newbie
*
Posts: 2


« Reply #3 on: September 25, 2007, 06:45:32 pm »

I must be missing something... I get the "File does not exist. Make sure you specified correct file name." error also.

My download.php info...
// Download folder, i.e. folder where you keep all files for download.
// MUST end with slash (i.e. "/" )
define('BASE_DIR','/www.marshallad.com/media/new_spots/');

// log downloads?  true/false
define('LOG_DOWNLOADS',true);

// log file name
define('LOG_FILE','downloads.log');

My HTML file address...
<a href="http://www.marshallad.com/media/new_spots/download.php?f=gowildpromo25.mpg"><img src="http://www.marshallad.com/images/download_btn.png"></a>

Please help. I'm sure you can tell I am a newbie...
Thanks
Logged
zubrag
Administrator
Hero Member
*****
Posts: 753


WWW
« Reply #4 on: September 26, 2007, 03:57:10 am »

Are you sure the path is correct? /www.marshallad.com/media/new_spots/

Save following as php file, place in the folder where download.php resides, and open in browser. It will show you the path

<?php
echo dirname(__FILE__);
?>
Logged
flyfisher2
Newbie
*
Posts: 2


« Reply #5 on: September 26, 2007, 03:33:04 pm »

That did it! I just didn't have my path correct from our hosting server.

I am so grateful!  Thank you! Thank you!  My first PHP script  Smiley

Thanks so much,
flyfisher2
Logged
andrew
Newbie
*
Posts: 1


« Reply #6 on: April 05, 2008, 11:16:04 pm »

Save following as php file, place in the folder where download.php resides, and open in browser. It will show you the path

<?php
echo dirname(__FILE__);
?>
I had tried, but I get "d:\hosting\andrewkong\images"
It does not work, still display "File does not exist. Make sure you specified correct file name."

script location = http://andrewkong.ws/download.php
file location = http://andrewkong.ws/images/abc.jpg
Logged
macdaddy
Newbie
*
Posts: 3


« Reply #7 on: July 12, 2008, 08:33:38 pm »

Hello,

i have downloaded and installed this script and i am getting the same error, this is what my settings look like


define('ALLOWED_REFERRER', '');

define('BASE_DIR','C:\Inetpub\webfolder\clientname\uploads/');

define('LOG_DOWNLOADS',false);

define('LOG_FILE','downloads.log');

(i changed the path a bit for securty, but u see what i mean
Logged
macdaddy
Newbie
*
Posts: 3


« Reply #8 on: July 12, 2008, 08:46:16 pm »

ok, i have a found a bug,

i have a folder structure on my website

the file that the download folder is in is pages, all the files are in uploads which is side by side with pages

if i put the documents to download in the pages folder it works, but it wont get files from uploads folder

eg..

index.php
PAGES FOLDER (download script is here)
UPLOADS FOLDER (files are here)


Logged
macdaddy
Newbie
*
Posts: 3


« Reply #9 on: July 12, 2008, 09:04:46 pm »

ok, i have have further testing, what i have discovered is that the script simply does not like a folder called uploads, it works in any other folder with a different name
Logged
Pages: [1]
  Print  
 
Jump to:  

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