Announcement

  •  » Engine
  •  » Change image upload path

#1 2010-10-07 15:56:26

rock
Guest

Change image upload path

is there any to change the upload images path to diffrent folder or diffrent server ??

 

#2 2010-10-07 23:27:44

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13277

Re: Change image upload path

Hi rock and welcome to Piwigo forums :-)

1) install/activate [extension by Piwigo Team] LocalFiles Editor from screen [Administration > Plugins > Manage]

2) open [Administration > Plugins > LocalFiles Editor > Local config] and paste the following code:

Code:

$conf['upload_dir'] = './another_upload_directory';

This is where pLoader/UploadForm adds photos. This path must be relative to  the Piwigo installation directory (but can be outside, as long as it's reachable from your webserver).

Offline

 

#3 2012-02-18 10:31:54

delakut
Member
Munich, Germany
2012-02-14
9

Re: Change image upload path

I changed my $conf['upload_dir'] to '../../files/piwigo'. I'm able to upload pictures with the flash uploader to this directory. That works fine. My problem is now that piwigo is not displaying the pictures in my album. I get the error message the file does not exist. It would like to safe my pictures in the files directory outside the html directory to backup them seperately.

Error Log:
[Sat Feb 18 09:33:37 2012] [error] [client 87.174.99.117] File does not exist: /var/www/html/web123/html/files, referer: http://www.das-zweite-konglomerat.de/gallery/

My directory structure:
/files/piwigo_pictures
/html/gallery_installation

Offline

 

#4 2012-02-18 11:02:01

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13277

Re: Change image upload path

Hi delakut,

Indeed, $conf['upload_dir'] must be a direct or indirect sub-directory of your Piwigo installation, to make it visible through HTTP.

In your case, here is what I would do :

1) in your "gallery" directory, remove "upload"
2) in your "gallery" directory, create a symbolic link "upload" to "../../files/piwigo"

Offline

 

#5 2012-02-18 14:56:47

delakut
Member
Munich, Germany
2012-02-14
9

Re: Change image upload path

It works, thanks a lot.

A quick guide:
I created the symbolic link with php. You only need to copy a php file to your root directory and start it in your browser. The code is:

<?php
if (symlink('/var/www/html/web123/files/piwigo', '/var/www/html/web123/html/gallery/upload'))
{
  echo "Symbolic link was created";
}
else
{
  echo "Symbolic link was not created";
}
?>

It is possible that you need to change the chmod to 755.

The upload_dir stays like it is. You don't need to change it anymore.
$conf['upload_dir'] = './upload';

Offline

 

#6 2012-02-18 17:52:53

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13277

Re: Change image upload path

delakut wrote:

A quick guide:
I created the symbolic link with php

Very smart. As a Linux user I would have said "if you don't have SSH access, you can't create a symbolic link".

Offline

 

#7 2015-02-27 12:13:49

adrian_vg
Member
Sweden
2015-02-27
10

Re: Change image upload path

rock wrote:

is there any to change the upload images path to diffrent folder or diffrent server ??

Hi there!

I'm confused. Can I use this symbolic link "trick" to integrate my existing Gallery2 folder-structure with pics into PWG?

As I've about 20k pics in the G2-structure (and on a particular partition due to its size), I'm not to keen about re-importing all the pics to the small galleries-folder in the PWG-install.

Any tips or tricks available to do this?

I did try the Menalto2PWG-plugin but got a wjole load of errors. If those are relevant I can post them as well.

Thanks.

Last edited by adrian_vg (2015-02-27 12:16:57)

Offline

 

#8 2015-02-27 13:05:18

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: Change image upload path

yes

a symlink is a symlink, the origin of what your are linking has no impact

of course you will loose all your data, like if you made a fresh upload in Piwigo

Offline

 

#9 2015-02-27 13:48:11

adrian_vg
Member
Sweden
2015-02-27
10

Re: Change image upload path

mistic100 wrote:

yes

a symlink is a symlink, the origin of what your are linking has no impact

of course you will loose all your data, like if you made a fresh upload in Piwigo

Thanks, loosing the data is of no consequnce as this is a new PWG install (it's empty).

So, in short, if I create symlinks as above and then run the Menalto2Piwigo plug, I should be able to integrate the current folder structure as is into PWG.

Did I understand that correct?

Thanks.

Last edited by adrian_vg (2015-02-27 13:50:40)

Offline

 

#10 2015-02-27 13:57:06

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: Change image upload path

and absolutely don't know about the migration
I answered for the symlink

if you don't care about the data then you don't need the migration plugin and you fall in the standard sync procedure http://piwigo.org/doc/doku.php?id=user_ … ure#by_ftp

edit: I read the mini-guide of Menalto2Piwigo and it should work

Offline

 

#11 2015-02-27 14:33:29

adrian_vg
Member
Sweden
2015-02-27
10

Re: Change image upload path

mistic100 wrote:

and absolutely don't know about the migration
I answered for the symlink

if you don't care about the data then you don't need the migration plugin and you fall in the standard sync procedure http://piwigo.org/doc/doku.php?id=user_ … ure#by_ftp

edit: I read the mini-guide of Menalto2Piwigo and it should work

Yupp, it did work most excellent.

Thank you very much for the assistance!

Now to customise the crap out of PWG. ;-)

Offline

 
  •  » Engine
  •  » Change image upload path

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact