Magento Forum

   
Image Upload HTTP error second post
 
phpkiller
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2009-07-09
Paris
 

It’s strange, in firefox3 it works now. I don’t know why ?
but it’s ok. tks

 
Magento Community Magento Community
Magento Community
Magento Community
 
blst
Jr. Member
 
Total Posts:  8
Joined:  2009-06-05
 
quanza - 28 February 2009 04:29 AM

People, if you’re using .htaccess/.htpasswd files to protect your site, you need to allow POST calls to go through; they’re being blocked b/c the AJAX call doesn’t know to use your cookie.

Just use the LimitExcept directive:

AuthUserFile <path to your .htpasswd>
AuthType Basic
AuthName 
"Some site name"

<LimitExcept POST>
    Require 
valid-user
</LimitExcept>

That should do it.

this did it for me. thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mig500
Jr. Member
 
Total Posts:  11
Joined:  2009-02-16
 

Hello all

I have had the same problem and lost 2 days trying to solve it. The solutions presented here did not work for me. The only solution that worked is the following and I really hope that helps someone.

add a new file php.ini in magento root with:

magic_quotes_gpc = off
short_open_tag = on
extension=pdo.so
extension=pdo_mysql.so

Logout magento and login

Upload photos

It should work fine now.

Miguel

 
Magento Community Magento Community
Magento Community
Magento Community
 
Azim
Sr. Member
 
Total Posts:  97
Joined:  2008-09-17
NY, USA
 

Miguel,
You the man, I have been fightinf this thing ofr last two weeks and no help. But your trick just solved it. Thanks man.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeramey
Jr. Member
 
Total Posts:  5
Joined:  2009-08-05
 

I’ve tried all of the suggestions, but I’m not sure I’m even attacking things from the right angle.

I ran into the issue after having a working site for months, and had a little panic.  Then I realized I can only get the error on one computer.

For the sake of everyone else’s debugging

I’m running Windows Vista, Flash 10r22, and having it fail in Firefox, Chrome, and IE8.  Creating a new account on this computer also doesn’t seem to help (which to me would rule out the browsing history/cache issue).  Other than Windows files, I’m not sure what could be the hold up at this point.

Any guesses?

 
Magento Community Magento Community
Magento Community
Magento Community
 
djooker
Jr. Member
 
Total Posts:  11
Joined:  2009-09-03
London Town
 

i am using ssl on admin
the problem is caused by the directory protection (i need this until the site goes live)

I tried all of the possible fixes mentioned above in the whole thread:

suhosin.session.cryptua off
(in htacces and/or in php.ini)

pdo added

secfilterengine off
scanpost off
(in htaccess)

flash latest(10.0.32.18)

<LimitExcept POST>
    Require 
valid-user
</LimitExcept>
--> into apache configuration where the directory protection is

/tmp dir and permissions fine everywhere

SetEnvIfNoCase Content-Type "^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
(in htaccess)

still getting http error on product image upload safari 4 and ff 3.5 mac os x 10.5.8
the server is a centos5 64bit dedicated plesk server at 1and1

the only thing I haven’t actually tried is to flush the Mage cache...the code has changed since…

And finally the solution came:

i read this arcticle :
http://www.edmondscommerce.co.uk/blog/apache/plesk-mod-security/

so I put in my <VHOST DIR>/conf/vhost.conf and vhost_ssl.conf the following:

<IfModule mod_security.c>
    
SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>
<
Directory "<DIR TO VHOST>/httpdocs">
    <
LimitExcept POST>
        Require 
valid-user
    
</LimitExcept>
</
Directory>

and ran on the command line:

/usr/local/psa/admin/bin/websrvmng --v
then
service httpd restart

bingo !

 
Magento Community Magento Community
Magento Community
Magento Community
 
bnemecek
Jr. Member
 
Total Posts:  1
Joined:  2009-04-22
 
quanza - 28 February 2009 04:29 AM

People, if you’re using .htaccess/.htpasswd files to protect your site, you need to allow POST calls to go through; they’re being blocked b/c the AJAX call doesn’t know to use your cookie.

Just use the LimitExcept directive:

AuthUserFile <path to your .htpasswd>
AuthType Basic
AuthName 
"Some site name"

<LimitExcept POST>
    Require 
valid-user
</LimitExcept>

That should do it.

This worked for me. Thanks smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
jplm197019
Jr. Member
 
Total Posts:  1
Joined:  2009-11-10
 
mattiasmac - 09 February 2009 08:10 PM

OK. I figured it out. Go into the mod_security configurations and comment this line #SecRule HTTP_User-Agent “^Shockwave Flash”
It should work after that.

This is the solution

Thanks very much

 
Magento Community Magento Community
Magento Community
Magento Community
 
QIKAZZ
Jr. Member
 
Total Posts:  8
Joined:  2009-08-25
 

well, I spent hours and hours on this, trying everything, rang my host provider, and he put this line in the php.ini file that was on the host, 1 level above where my viewable website is stored.

upload_tmp_dir = /usr/home/qikazz/tmp/

As far as uploading files to view from web my site the root seen by my ftp client is /www/htdocs/

The location of the php.ini file he made is /www/

Hope this helps someone.

Cheers

Azz

 
Magento Community Magento Community
Magento Community
Magento Community
 
Belfair
Jr. Member
 
Total Posts:  9
Joined:  2009-12-29
 

I had this issue also. I was trying to upload in Firefox (everything else seemed to work fine). I remembered I was playing around with proxy settings in Google Chrome --- which I think uses the same internet setting as IE --- the proxy settings weren’t working but I left then enabled to play with later. Since that was the only thing I changed on my pc since the last time I uploaded pictures into Magento, I disabled the proxy settings in Google Chome and the files uploaded perfectly in Firefox… go figure…

 
Magento Community Magento Community
Magento Community
Magento Community
 
meemal
Jr. Member
 
Total Posts:  23
Joined:  2009-11-06
Scotland
 
yinzer - 07 May 2009 05:28 AM

I was able to fix this error by adding the following to my .htaccess file (all one line):

SetEnvIfNoCase Content-Type "^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"

Thanks Yinzer.  That worked for me, nothing else on this thread did.  Saved me a headache!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matthieu Fauveau
Jr. Member
 
Total Posts:  11
Joined:  2009-11-08
France
 

The problem can also be related to PHP suhosin patch. If you have SSH access to your server and can edit /etc/php5/conf.d/suhosin.ini you can either edit the following variables : 
suhosin.get.max_totalname_length
suhosin.post.max_totalname_length
suhosin.post.max_value_length
suhosin.request.max_totalname_length
suhosin.request.max_value_length
suhosin.request.max_vars
or completely disable the module… it’s up to you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
magentoinsydney
Jr. Member
 
Total Posts:  1
Joined:  2010-03-03
 

I just fixed the error of image uploading. When I tried to upload an image for a product, it always prompted “File is not uploaded”.

I spent whole morning looking for various posts and methods to solve this, but all failed. Finally, I compared my phpinfo() with the other phpinfo() in another successful server.

I found the reason is I didn’t set the “upload_tmp_dir” in my php.ini, so the solution for my case is

1) open your php.ini, find the “upload_tmp_dir”, set the value. In my case, the php located in c:/php5, so upload_tmp_dir ="C:/php5/tmp"

2) restart your webserver( Apache or IIS (note: I am using IIS7.0 )), double check the phpinfo(), make sure you can find the upload_tmp_dir is set.

Note: Around the upload_tmp_dir, there are some related options, for me.
--------------------------------------
; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir ="C:/php5/tmp"

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
--------------------------------------

Hope it is useful.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nasha
Sr. Member
 
Avatar
Total Posts:  138
Joined:  2009-04-15
 

Hi
I solved this by installing ‘no-flash-uploader’ extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
WScott84
Jr. Member
 
Total Posts:  17
Joined:  2010-05-03
 

.htaccess will not work for “Mod Security 2” I found that out after calling my hosting.  They have to change the setting themselves.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top