upload directory

gogrin

New member
hello, i got a table to upload images, the file is being uploaded with the insert form, but in the wrong directory, it's supossed to be uploaded into the /uploads/ directory instead is being uploaded into the main one,

ive been playing with this line in the config.php file

// absolute path of the upload dir - please put slash (/) at the end
// e.g. 'c:\\data\\web\\dadabik\\uploads\\' on windows systems
// e.g. '/home/my/path/dadabik/uploads/' on unix systems
// make sure the webserver can write in this folder and in the temporary upload folder used by PHP (see php.ini for details)
$upload_directory = '';

but it still uploads the file into the same directory, it just changes the name of the file, or gives a php error when i upload.

what do i need to do?

thanks



Post Edited (12-18-06 03:21)
 

DebbieS

DaDaBIK Guru
There are two lines for the uploads --

// relative url from the DaDaBIK root dir to the upload folder - please put slash (/) at the end
$upload_relative_url = 'uploads/';

// absolute path of the upload dir - please put slash (/) at the end
// e.g. 'c:\\data\\web\\dadabik\\uploads\\' on windows systems
// e.g. '/home/my/path/dadabik/uploads/' on unix systems
// make sure the webserver can write in this folder and in the temporary upload folder used by PHP (see php.ini for details)
$upload_directory = '';

Ensure you have both set correctly and that your uploads directory has the appropriate permissions set.

 

gogrin

New member
can you please be a little more specific, i know about the other upload line but i still cant get it to work and the folder does have permission.. plz help
 

DebbieS

DaDaBIK Guru
The instructions in the config.php file seem pretty self explanitory to me. You have to set both variables ... example:

uploads directory web address:

http://web.site.url/dadabik_dir/uploads/

$upload_relative_url = 'uploads/';

$upload_directory = '/home/my/path[b/dadabik_dir/uploads/';

The web address is the web address.
The upload relative url is the url of the uploads directory relative to the location of the index.php file.
The upload directory is the physical location on the server itself. Servers using virtual hosts (w/Apache) will have a path like /htdocs/websitename/dadabik_dir/uploads/. If you don't know what this path is, you will have to contact your server admin, try to figure it out with an ftp client or purposely create an error in your index.php file so php will display the full path on screen for you.


Are you sure you have uploads enabled in PHP? I seem to recall there was something posted some time ago about php uploads.

 

ghiebert

New member
Actually to a new user of this type of program, and to somebody who is new to dealing with addresses on servers, this is quite an understandable question. I myself qualify on both counts, I'm a newbie. Taking the advice of DebbieS, I logged in with my FTP program and navigated to the uploads directory to see what the path would be. That path seemed a bit short:

/public_html/dadabik/uploads/

So I took her further advice and placed the index.php file in the uploads directory. Then I edited it so that the syntax was wrong on one line (I took out an apostrophe). Viewing the error message I got when I ran this file, I was able to get the full path to the uploads directory from the viewpoint of the server. I would never have guessed:

/home/mysitename/public_html/databik/uploads/

where the website address would be

www.mysitename.com

Server addressing remains, to me, an enigma.

Regards,
Gord
 

DebbieS

DaDaBIK Guru
The actual file paths on web servers varies depending on how the server admin has set it up and configured it. There is information on the internet related to this, but for the most part, it is something you have to either figure out yourself or ask your server admin.

DaDaBIK assumes that users who are downloading and installing this program have a basic understanding of web and server addressing and paths. Because these settings can vary from server to server, we also assume that users would contact their server admins if they have questions about paths on their specific server.

 
Top