Menu

Media Directory Problems (Not Allowed)

Help
branb
2010-04-19
2013-05-30
  • branb

    branb - 2010-04-19

    Hello,

    I'm running:

    - PGV 4.2.3
    - Linux (Debian)
    - Apache 2.2.3
    - MySQL 5.0.32 (client version)
    - PHP 5.2.9

    I'm experiencing a problem with my media directory.  I first noticed the problem when I encountered an error (see below) when I went to manage my media.  What I discovered was that the folder didn't even exist.  So, I tried uploading it again, via FTP, to my "website/htdocs/phpgedview/" directory.  My FTP client couldn't do it.  It encountered an error.  I then tried creating a folder named "media" - it simply didn't carry out the direction.  I succeeded in creating a folder called "test".  I then attempted to rename the folder to "media", but that also failed.

    I am left with the conclusion that my website host has software running that automatically analyzes files and directories and when it encounters something that is perceived as a security threat it deletes them and, then blocks them from being created.

    The same thing occurred with my "index" folder.  However, I tried putting a  folder named "files" up one directory outside of the "htdocs" folder.  I then told PGV that the new _Index File Directory _ was and it worked fine after that.

    So, my question is, "Is there a similar solution or work-around that can help me resolve this problem?"

    -----------------error msg------------------
    media/thumbs
    ERROR 2: mkdir() [function.mkdir]: Permission denied
    0 Error occurred on in function mkdir
    1 called from line 130 of file functions_mediadb.php in function check_media_structure
    2 called from line 302 of file media.php
    Warning: mkdir() [function.mkdir]: Permission denied in /imedia/users/WEBSITE/htdocs/phpgedview/includes/functions/functions_mediadb.php on line 130
    The media folder is corrupted.
    ------------error msg end------------------
    

    Thank you very much for your valuable time and effort,

    -BRANB

     
  • Greg Roach

    Greg Roach - 2010-04-19

    This is an issue of file ownership/permissions.

    The scripts run as the webserver (typically an account called "www-data", "nobody", "apache", etc.).

    Therefore you must give certain files and folders *global read/write access*.  These are config.php, index/ and media/

    So, you will have a folder media/ owned by you, with global write access.
    Then PGV will create subfolders such as media/photos/ owned by the webserver

    Use your FTP client to check both the ownership and permission of these files.

     
  • branb

    branb - 2010-04-19

    Thank you!

    I found the permission settings for my hosting account and changed them to "List" and that fixed it!

    Much appreciated,

    -BRANB

     
  • branb

    branb - 2010-04-20

    I have a new twist on the same problem: Adding Subdirectories to the Media Firewall

    I was reading about using the Media Firewall security advantages and I decided to implement it.  And, I got it to work!

    But, when I tried to add my own sub-directories (i.e. "/index/media/Family/photos/) to the media firewall I encountered the same problems as I did before (please see original entry for support request).

    In this case there are no Apache server permission settings since the Media Firewall is out side the website files directory.

    I've had no trouble with the index folder or the media folder living outside the website files directory.  But, creating sub-directories is suddenly a problem.

    Any advice would be greatly appreciated.

    Thanks,

    -BRANB

     
  • Stephen Arnold

    Stephen Arnold - 2010-04-20

    Move your media back to the main, unprotected media folder by disabling Media Firewall. Create your sub-directories and then move the entire kit-bang-and-kaboodle back by enabling.

    BTW, while I completely understand each admin's desires to organize media in this fashion, I found I had to move every media item uploaded by my users as they had no comprehension of the whys and whatfors of this plan, and I later simply abandoned it. It was hard enough to get them not to name a photo 123.jpg or john.jpg, let alone having them understand 9000 surname folders.
    -Stephen

     
  • branb

    branb - 2010-04-20

    Thanks Stephen.

    So, I have to ask; what did you end up doing?  I'm assuming you have had to do some renaming in order to prevent conflicts since everyone's digital camera/scanner generates the type of file name (i.e. "photo0123.jpg").

    When I posed the question, "Should I set file size limits?" (so that my users would be restrained in the photo sizes the would upload), other forum members suggested that the admin should handle all of the uploading of images.  The argument being that not only will the users not maintain the correct naming convention and such, but that also the information about the photo needs to be maintained (i.e. who submitted it, who is in the picture, etc.).

    I'd be interested in your opinion?

    -BRANB

     
  • Stephen Arnold

    Stephen Arnold - 2010-04-20

    Branb
    I keep all mine in one folder - over 3500 media images. OUCH. And I have to act as a moderator on media, quite often changing file names to meet my naming scheme and adding/changing titles and notes, but that's a far cry better IMHO than trying to have them email me every media item, as I'd have no idea who was in the photo, when it happened, where it took place and more.

    Frankly, when you deal with media, its never a pleasing experience, based on everyone's inexperience.
    Stephen

     
  • knorway

    knorway - 2010-04-20

    This is yet another place where at some point a little change to PGV may be helpful, in that, we set a moderation / update flag that prevents people from updating data relating to an individual's GED_DATA, but to my knowledge that is not true for media.  Uploading media to a "holding pen" associated with the individual or family connected to the file but that allows the admin to change size, comments, file name, move to appropriate files structure, etc would be a nice new feature..

     
  • Stephen Arnold

    Stephen Arnold - 2010-04-20

    Like any change to the gedcom, new media appears in the pending changes. It is for this reason I know that the media needs renaming or enhancement of title or notes or added to other affected individuals or families.
    Stephen

     
  • Gerry Kroll

    Gerry Kroll - 2010-04-21

    Sorry to jump in here at this late stage in the discussion:

    Stephen's advice about disabling/enabling the media firewall isn't necessary.  Here's a MUCH simpler method:

    1. Create your new directory in the normal "/media" directory.  Upload your new images as you wish.
    2. Use the Manage Media page and navigate to the newly created directory.
    3. PGV will tell you that the new directory is NOT under the control of the Media Firewall - it's not in the "protected" file space.
    4. Just click the button that tells PGV to move the whole directory to the protected file space.

     
  • Gerry Kroll

    Gerry Kroll - 2010-04-21

    Another point:
    When the Admin uploads media, he can specify a new directory name that doesn't already exist.  PGV will create the directory.  Ordinary users are restricted to already-existing directory names.  The Admin can rename the incoming file as part of the upload process; ordinary users can't.

    Likewise, using the Edit Media interface, the Admin can rename and also move media files at will.  Missing (new) directories will be created as required.  There should be no need to do any of the file system manipulations outside PGV.  If the media files are already linked to persons, families, etc.  you definitely should NOT do any file/directory manipulations of those media files.  Doing so will corrupt the database since PGV isn't aware that changes have been made outside the program.

    Corrupted media databases can be fixed.  You need to use the Edit Media interface (ignore error messages about missing files) and correct the file name or directory name that is shown.  Only the Admin can do this.  Again, ignore the error messages.

     

Log in to post a comment.