Author Topic: Using a different Local Drive for media  (Read 6288 times)

0 Members and 1 Guest are viewing this topic.

Offline WeZ

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Using a different Local Drive for media
« on: August 08, 2006, 10:52:11 AM »
Hello...

can someone tell me what i need to do to be able to house my media on a different local drive on the same server?

if i modify the MEDIA_DIR definition in Constants.php it appears to only work for defining where the directory is in relation to the script i.e. ../../data/media

if i place the media anywhere on the same drive, changing this definition seems to work... however it does not work if i hard code the location 'e:/data/media' for e.g.

BUT, if i hard code the MEDIA_PATH definition in global.php, then it will add images and resize them and generate the thumbs perfectly - however when the page refreshes it shows no images...

if i view the souce it shows the file to have a src location of e:/data/images/2/ etc etc and hence because e:/data does not exist on my local machine, it fails...

can anyone help me solve this?

Thanks
WeZ

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Using a different Local Drive for media
« Reply #1 on: August 08, 2006, 02:34:55 PM »
I dont think windows OS supports virtual directories...I belive up comming Vista will support it, but I think currently its not possible...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline WeZ

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Using a different Local Drive for media
« Reply #2 on: August 08, 2006, 05:39:02 PM »
V@no,

Long time... i trust you are well...

Interesting enough, if i were running off IIS i would be able to do it :-) ... but i decided to inflict massive ammounts of pain on myself by trying my luck with Apache...  8O
kidding...

From Tinkering around i found where i can make a different hostname in Apache (abc.domain.com) point to a diffent drive and that works fine, but how do i do a virtual dir in apache so that i can have www.domain.com/data point to a different drive...

i could use a physical symbolic link but i have been burnt by those :-)

V@no, thanks for your time as per always and i appreciate any feedback you can give.

Kind Regards,
WeZ

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Using a different Local Drive for media
« Reply #3 on: August 09, 2006, 03:42:06 AM »
Actualy on Unix servers you would be able create symbolic link with something like:
Code: [Select]
ln -s /original/path /new/pathAs of domains pointed to different locations, it wont work, because 4images access files localy, not via internet paths.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline WeZ

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Using a different Local Drive for media
« Reply #4 on: August 19, 2006, 01:29:34 PM »
Hi V@no,

I overcame my problem here by moving my 4images to the new drive and in my php configured the hostname gallery.mysite.com to point to the new location.

i only have one small problem with this - the site was installed as http://www.mysite.com/4images and it is that when i login or logout it dies trying to get to http://gallery.mysite.com\/index.php

the rest of 4images appears fine...

if i remove the "\" manually the link works. when trying to login and after the refresh dies and i manually remove the "\" i see that i am in fact logged in, it is just the reloading of the page that seems to inset that "\" into the URL.

i read something like this but can't find it in the forum ... any idea's?

Kind Regards,
WeZ

Offline WeZ

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Using a different Local Drive for media
« Reply #5 on: August 19, 2006, 01:42:30 PM »
Hi V@no,

in constants.php i uncommented
Code: [Select]
define('SCRIPT_URL', 'http://gallery.mysite.com'); //no trailing slash

and the problem apprears to have dissapeared. is there any risk associated to this change (why was it commented out in the first place) or should i put it back?

Kind Regards,
WeZ

p.s. now you have proof i try myself as well :-)