1
Anonymous
Can't upload images :(
  • 2006/11/28 14:14

  • Anonymous

  • Posts: 0

  • Since:


Hi,

Trying to upload images doesn't seem to work for me even from within the Admin section. I'm sure I'm doing something basic wrong.

I've created a category called website, which has a max filesize of 100000 bytes, max width of 500px, max height of 375px.

I've CHMODed the "upload" directory to 777. There's a subdirectory called "images" in there and I've CHMODed that to 777 just to be sure.

When I try to upload an image called colourlogo.gif (100 x 100px, 4,674bytes) from my HDD I get the following error:

"Errors Returned Whilst Uploading
Invalid image file"

I've turned on the debug mode and get the following 6 errors:

1. Warning: getimagesize(): open_basedir restriction in effect. File(/tmp/phpQWIqjA) is not within the allowed path(s):

(/home/llanmonforuk/public_html) in file /class/uploader.php line 392

2. Warning: getimagesize(/tmp/phpQWIqjA): failed to open stream: Operation not permitted in file /class/uploader.php line

392
3. Warning: Failed fetching image size of /tmp/phpQWIqjA, skipping max width check.. in file /class/uploader.php line 397
4. Warning: getimagesize(): open_basedir restriction in effect. File(/tmp/phpQWIqjA) is not within the allowed path(s):

(/home/llanmonforuk/public_html) in file /class/uploader.php line 412
5. Warning: getimagesize(/tmp/phpQWIqjA): failed to open stream: Operation not permitted in file /class/uploader.php line

412
6. Warning: Failed fetching image size of /tmp/phpQWIqjA, skipping max height check.. in file /class/uploader.php line 417


I'm tearing out what little hair I have left

All (helpful) suggestions gratefully received

2
stefan88
Re: Can't upload images :(
  • 2006/11/28 14:30

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,
If you are also administrator of the box or have access to php.ini, you can edit it - the setting about upload temp dir or base dir.
What version of XOOPS are you using?
If you do not have access to php.ini file, for 2.0.13.2 you can use class/uploader.php from older version - 2.0.13.1 will be ok.
..

3
Anonymous
Re: Can't upload images :(
  • 2006/11/28 14:43

  • Anonymous

  • Posts: 0

  • Since:


Hi,

I am the site's webmaster.

>>What version of XOOPS are you using?<<

Using 2.0.16

>>If you..........have access to php.ini, you can edit it - the setting about upload temp dir or base dir.<<

Where do I find php.ini? If its below the root folder then I don't have access to that (my host won't let me!).

>>If you do not have access to php.ini file, for 2.0.13.2 you can use class/uploader.php from older version - 2.0.13.1 will be ok.<<

There is a file called uploader.php in the /class folder of my website. What do I need to alter? Sorry, I'n a bit new at this.

Many thanks

4
Anonymous
Re: Can't upload images :(
  • 2006/11/28 16:43

  • Anonymous

  • Posts: 0

  • Since:


Just had a thought.......whilst I have permission to upload files generally, perhaps I'm trying to upload a filetype/mimetype that isn't permitted?

I vagueely remember something about this when setting the site up - can someone point me in the right direction, please?

Many thanks

5
jensclas
Re: Can't upload images :(

have you tried a search 'set mimetypes'?

6
jordi_rc
Re: Can't upload images :(
  • 2006/11/28 21:06

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Hi

Try CHMOD -R 777 directory/

and also CHMOD 777 the files to upload if you use linux.

It worked for me.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

7
boss_hog
Re: Can't upload images :(
  • 2006/11/28 21:57

  • boss_hog

  • Just popping in

  • Posts: 17

  • Since: 2005/6/11


Quote:

JAVesey wrote:
"Errors Returned Whilst Uploading
Invalid image file"

I've turned on the debug mode and get the following 6 errors:

1. Warning: getimagesize(): open_basedir restriction in effect. File(/tmp/phpQWIqjA) is not within the allowed path(s):

(/home/llanmonforuk/public_html) in file /class/uploader.php line 392



Hi JAVesey,
how I understand this error, is that php is not allowed to run scripts inside the /tmp.

If this is on a hosted box see if they can create a /tmp in "your_account"/home/ or "your_account"/. Then set it as the tmpdir for php.

Good luck.

8
Anonymous
Re: Can't upload images :(
  • 2006/11/29 11:58

  • Anonymous

  • Posts: 0

  • Since:


Hi,

Problem sorted after I contacted the hosting company.

Quote:
Hosting company wrote:
Your /tmp file was unreadable as it had permissions set to 666, I have set this to 777 now so it can be accessed for open_basedir


All works as it should

Thought I was going a bit doolally for while

Thanks for all the advice, guys.

Login

Who's Online

265 user(s) are online (240 user(s) are browsing Support Forums)


Members: 1


Guests: 264


Harald0123,

more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits