Unable to upload images on a mac

Permalink
Hi,

i just tried to upload an image to my website and it will not work!

i made a 1 min video of my screen and my problem

http://www.screencast.com/users/Mnkras/folders/Jing/media/c56d0ff1-...

Mnkras
 
TravisN replied on at Permalink Reply 1 Attachment
TravisN
I'm getting the same problem. I don't know why, but I just hadn't tested the upload facility until now.

From what I can tell this is an old problem discussed on several threads and is still an issue with the 5.2 release.

Can you please replace the "al_upload_process_single.php" file located in /concrete/tools with the file attached. I have improved the error reporting to give an exact error.

I am getting "Missing temporary folder". I am still yet to nut down exactly why the temp folder is missing, or where it is meant to be located.

Note: the enhanced error messages will only work for the single upload. I suspect it is still the same issue on multiple.
pberry replied on at Permalink Reply
I got error #6 "Missing Temporary Folder." Problem is, I've set

upload_tmp_dir = tmp


and created a tmp folder everywhere I can think of. They're all set to 755. No clue what to do.
TravisN replied on at Permalink Reply
TravisN
There could be one of several things that could be your problem, and it all depends on the way your server is set up.

1. php settings could be folder specific. This would mean you need to have a copy of your php.ini file in the root of your concrete directory. This doesn't have to be the whole file. It can be just the settings you want to override.
2. Your host may not allow php overrides. Speak to your host about this.
3. you may need to use .htaccess instead of php.ini
4. upload_tmp_dir = tmp would need to be placed in the root of your server. Not the root of your web directory. For instance on my server I have a root folder and then all of my web files go into public_html.


You can check if the settings you changed in your php.ini have taken, by creating a new php file that simply contains the php functionplace this file in the root of you concrete directory and load it directly. Search for the setting and you will soon see if you have actually overridden it.

Hope that gives you some idea where to look
pberry replied on at Permalink Reply
Went in this morning and here's a recap of the steps I started with.

1. Our server does allow the override. I had found this earlier in needing to turn short_open_tag on.
2. I changed the ini file to have upload directory = tmp.
3. I confirmed this with phpinfo.
4. I uploaded your file (great work, btw) and got error 6, missing folder.
5. After each upload fail, I put a new tmp directory in a different directory.

And here's the breakthrough:

6. I looked at the full directory listing for the loaded php.ini file. (I already had a directory named tmp already present in the same directory as the ini file.)
7. I changed the ini file to include the same path as the ini file according to phpinfo.

Works like a charm :)
TravisN replied on at Permalink Reply
TravisN
If your uploads are not working, it is because a temporary directory has not been specified.

To resolve the problem:
1. Open your php.ini file
2. Find the line "upload_tmp_dir". it may have a ; in front of it. Delete the ;
3. Enter the path to and name of your temporary directory. If you don't already have one, enter the details of where it will be and create the folder on your server.
4. Make sure the directory has at least Apache read write permissions
5. Restart the server


for example I entered

upload_tmp_dir = tmp

and created a directory "tmp" in my root.

I would still recommend replacing the "al_upload_process_single.php" with the attachment above. It will give you a clearer idea of what the problem is, should one occur. On this note it will only work if you replace the core file. Placing it in the root "Tools" directory will not work.
Mnkras replied on at Permalink Reply
Mnkras
Hey thanks for the upload TravisN it worked great!

ig to this error:

File upload error (1) : The file is bigger than this PHP installation allows

but it isn't! its 56kb! a jpeg image! it doesn't make sense
TravisN replied on at Permalink Reply
TravisN
The file size is also set in the "php.ini" file. Look for the line "upload_max_filesize". What does it say?

Follow
http://php.oregonstate.edu/manual/en/faq.using.php#faq.using.shorth...
for implementation options (ie 2Mb is 2M, default is an integer measured in bytes if no shorthand alpha follows)

another helpful page is
http://php.oregonstate.edu/manual/en/ini.core.php#ini.upload-tmp-di...
Mnkras replied on at Permalink Reply
Mnkras
is there a way to do it in .htaccess? i do not have access to php.ini
TravisN replied on at Permalink Reply
TravisN
It is possible to override the php.ini with folder specific .htaccess.

You first need to enable "AllowOverride" in your httpd.conf. You can research the net about the various options that can be entered, but for the ease of this conversation you can set it to "All".

Now, in your case you should be able to get away with only adding the following line to your .htaccess file

php_value upload_max_filesize 20M


Other people may need to add:

php_flag file_uploads On
php_value upload_tmp_dir temporarydir


where 'temporarydir' is the path to the tmp directory you nominate
Mnkras replied on at Permalink Reply
Mnkras
Thank you so much! the

php_value

worked like a charm!
colin4255 replied on at Permalink Reply
colin4255
In my case and many others too I suspect the htaccess file may be the only way to do this. It worked for me. Mine simply says

Header set X-UA-Compatible "IE=EmulateIE7"
php_value memory_limit 256M
php_value upload_max_filesize 20M
php_value post_max_size 20M

Within reason, you can change the '20M' or 20 megabyte values to whatever you want

Putting the <?php and ?> quotes in my htaccess file just renders the pages unviewable and I get an internal server error message

You may need to set both upload_max AND post_max values to get a file to actually upload.
Mnkras replied on at Permalink Reply
Mnkras
the <?php ?> tags are put in whenever you put something in the code tags on the forums its a bug :)