Image won't upload?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ashebrian
Forum Contributor
Posts: 103
Joined: Sat Feb 02, 2008 8:01 pm

Image won't upload?

Post by ashebrian »

hh
Last edited by ashebrian on Tue Mar 04, 2008 5:58 pm, edited 1 time in total.
User avatar
Sekka
Forum Commoner
Posts: 91
Joined: Mon Feb 18, 2008 10:25 am
Location: Huddersfield, West Yorkshire, UK

Re: Image won't upload?

Post by Sekka »

Ok, your second implementation is the correct one.

Code: Select all

$catImage = uploadImage('fleImage', SRV_ROOT . 'images/category/');
The reason you get a permission error is probably because you can't write to the target folder.

Change the CHMOD value on the target folder, 'category' to 777. This should solve your problem.
ashebrian
Forum Contributor
Posts: 103
Joined: Sat Feb 02, 2008 8:01 pm

Re: Image won't upload?

Post by ashebrian »

Whats CHMOD? never heard of it. I'm NOT hosting, as its hosted in austrailia with ms frontpage server. I've searched for CHMOD. If i'm not hosting the server how do i change 777? Use the following code?

Code: Select all

<?php
$ftp_server='server';
$conn_id = ftp_connect("$ftp_server");
ftp_login($conn_id, user, password);
ftp_mkdir($conn_id, dir/dir);
ftp_site($conn_id, 'CHMOD 777, dir/dir');
ftp_close($conn_id);
?>
It doesn't make sence for that to work as without u typing the username and password inside the code for access....how will that code know?
User avatar
Sekka
Forum Commoner
Posts: 91
Joined: Mon Feb 18, 2008 10:25 am
Location: Huddersfield, West Yorkshire, UK

Re: Image won't upload?

Post by Sekka »

Do you have FTP access to the server? If so, most FTP clients come with CHMOD'ing built in. Try SmartFTP if you don't have a decent client.

Right click the folder, and select 'Properties / CHMOD', or something similar. You will then be able to enter 777 or 0777 in a field.
ashebrian
Forum Contributor
Posts: 103
Joined: Sat Feb 02, 2008 8:01 pm

Re: Image won't upload?

Post by ashebrian »

Cheers, that was simple. Now my only prob is that the images won't load. Its the error image thats displayed. So that means the filepath is faulty. am i correct?
ashebrian
Forum Contributor
Posts: 103
Joined: Sat Feb 02, 2008 8:01 pm

Re: Image won't upload?

Post by ashebrian »

The commands not working? Error msg with smartFtp - i already had this before u mentioned it

Code: Select all

[03:05:48] 500 'SITE CHMOD 777 category': command not understood
User avatar
Sekka
Forum Commoner
Posts: 91
Joined: Mon Feb 18, 2008 10:25 am
Location: Huddersfield, West Yorkshire, UK

Re: Image won't upload?

Post by Sekka »

Not a clue then. Gone beyond my understanding of servers. I only know my way around LAMP.
Post Reply