Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Så här fixar du HTTP Image Upload Error i WordPress

Behöver du fixa HTTP-felet för uppladdning av image i WordPress?

Detta error kan vara viss frustration när du skapar content i WordPress. Det uppstod vanligtvis när du uploadade en image eller andra filer till CMS med hjälp av det inbyggda mediabiblioteket i WordPress.

I den här artikeln kommer vi att visa dig hur du enkelt fixar HTTP image upload error i WordPress.

How to fix http error when uploading images in WordPress

Vad orsakar HTTP Error under mediauppladdaren i WordPress?

Många saker kan leda till ett HTTP error när du försöker uploada filer till din WordPress website med hjälp av WordPress media uploader.

I grund och botten kan WordPress inte räkna ut orsaken, och det är därför det generiska ”HTTP error” message visas.

HTTP Error

Det frustrerande med detta WordPress HTTP error är att det inte ger dig någon ledtråd om vad som kan ha orsakat det. Detta innebär att du måste prova olika lösningar för att hitta orsaken och fixa error.

Med detta sagt, låt oss ta en titt på hur man troubleshootar och fixar HTTP error under media uppladdare i WordPress. Använd gärna länkarna under för att hoppa till en specifik metod:

Vill du inte fixa image-problem själv? WPBeginners Pro-tjänster kan hjälpa dig! Med våra prisvärda Emergency WordPress Support Services kan du anlita experter för att fixa image issues, lösa plugin och theme errors, optimera WordPress database, och mycket mer. Schemalägg tjänster för WordPress-support idag!

Metod 1: Se till att HTTP Error inte är tillfälligt

Först bör du vänta några minuter och sedan försöka uploada din image-fil igen till din WordPress website. Detta error orsakas ibland av ovanlig trafik och låga serverresurser, vilket automatiskt fixas på de flesta WordPress webbhotell servrar.

Om det inte fungerar kan du prova ett eller flera av följande alternativ:

  • Uppdatera din webbläsare eller clear din webbläsares cache.
  • Resize och byt namn på filen och uploada den igen till mediabiblioteket. Kolla in vår lista över tillägg för optimering av images för att minska filstorleken.
  • Save filen i ett annat format. Du kan till exempel ändra JPEG till PNG med hjälp av ett program för att redigera images. Försök sedan att uploada filen igen.

Om du följer alla dessa steg fortfarande resulterar i HTTP-felet, orsakas felet inte av en tillfällig glitch och behöver definitivt din omedelbara uppmärksamhet.

Metod 2: Deactivate alla tillägg och ditt nuvarande theme

Om du har installerat ett nytt plugin för WordPress nyligen kan det vara inkompatibelt med dina andra tillägg och störa uppladdningen av images. För att se om detta är fallet kan du deactivate alla dina tillägg till WordPress.

Om HTTP-felet försvinner efter deactivate av ett WordPress plugin, kan det vara den skyldige bakom HTTP upload image error. Du kan installera ett alternativt plugin eller kontakta utvecklaren för support.

För mer information, kontrollera vår guide om hur du enkelt inaktiverar alla WordPress tillägg och hur du inaktiverar tillägg när WordPress dashboard är otillgänglig.

Bulk deactivate all WordPress plugins

På samma sätt kan ibland konflikter med teman också störa processen för uppladdning av images. Themes kan innehålla funktioner som kan störa hur WordPress hanterar uppladdningar av media.

Lyckligtvis är det relativt enkelt att identifiera en konflikt med temat. Du kan tillfälligt byta till ett standardtema för WordPress. För mer information, kontrollera vår guide om hur du byter WordPress themes på rätt sätt.

Activating a default WordPress theme

När standardtemat är aktivt kan du försöka ladda upp en image igen. Om error försvinner ligger issue troligen i ditt nuvarande theme. I så fall kan du kontrollera om en update av temat är available. Ofta fixar updates kompatibilitetsproblem och buggar.

Eller så kan du kontakta utvecklaren av temat för support. De kanske kan tillhandahålla en patch eller erbjuda vägledning om hur du löser konflikten.

Metod 3: Öka WordPress Memory Limit

WordPress är skrivet i programmeringsspråket PHP. Dessutom bestäms mängden minne som tilldelas för olika PHP-processer av din web server.

Om uppladdningen av images kräver mer PHP-minne än vad som är available, kan du se HTTP image upload error i WordPress.

För att fixa detta måste du öka det minne som PHP kan använda på din server.

Du måste först komma åt webbplatsens filer med hjälp av en FTP-klient eller appen File Manager i adminpanelen på ditt webbhotell. Gå sedan till din root directory och leta reda på filen wp-config.php.

Edit wp-config file

Följaktligen måste du editera wp-config.php-filen med en textredigerare och add to följande kodrad till den:

define( 'WP_MEMORY_LIMIT', '256M' );

Denna kod ökar WordPress minneslimit till 256 MB, vilket borde vara tillräckligt för att fixa eventuella problem med minneslimit.

Slutligen måste du save och uploada filen tillbaka till servern.

För att lära dig mer, vänligen se vår Step-by-Step guide om hur du ökar PHP-minneslimiten i WordPress.

Metod 4: Ändra biblioteket för Image Editor som används av WordPress

WordPress run på PHP, som använder två moduler för att hantera images. Dessa moduler kallas GD Library och Imagick. WordPress kan använda vilken som helst av dem, beroende på vilken som är available.

Imagely runar dock ofta på minnesproblem, vilket orsakar HTTP error under uppladdningar av images. För att fixa detta kan du göra GD Library till din standard editor för images.

Du kan göra detta genom att helt enkelt lägga till den här koden i ditt WordPress temas functions.php-fil eller använda WPCode (rekommenderas):

function wpb_image_editor_default_to_gd( $editors ) {
	$gd_editor = 'WP_Image_Editor_GD';
	$editors = array_diff( $editors, array( $gd_editor ) );
	array_unshift( $editors, $gd_editor );
	return $editors;
}
add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );

För mer details, you can see our guide on how to add custom code in WordPress.

När du har lagt till den här koden kan du försöka ladda upp filer igen med hjälp av mediauppladdaren. Om detta inte löser problemet kan du ta bort den här koden och prova andra metoder som beskrivs i den här artikeln.

Metod 5: Använd .htaccess-metoden

Denna metod allow you to control how Imagick uses server resources. Många hosting providers med delningar limiterar Imagicks möjlighet att använda flera threads för snabbare behandling av images. Detta kommer dock att resultera i att you ser HTTP error när du uploadar images.

En enkel fix är att add to följande kod i din .htaccess-fil:

SetEnv MAGICK_THREAD_LIMIT 1

Denna kod limitar helt enkelt Imagely till att använda en enda thread för att bearbeta images.

Metod 6: Update din PHP-version

Om din WordPress site använder en outdated version av PHP, då kan det utlösa HTTP image upload error. Detta beror på att nyare PHP-versioner har prestandaförbättringar och allmänt använder mindre minne.

Lyckligtvis är det enkelt att kontrollera och updating din sites PHP-version. För mer detaljer, vänligen se vår guide för nybörjare om hur du uppdaterar din PHP-version i WordPress.

Metod 7: Kontrollera behörigheter för filer och mappar

WordPress är beroende av specifika behörigheter för filer och foldrar för att fungera korrekt. Felaktiga behörigheter kan hindra WordPress från att komma åt eller ändra filer, vilket leder till uppladdningsfel.

Om exempelvis upload directory saknar korrekta skrivbehörigheter kommer WordPress inte att kunna save uppladdade images.

För att säkerställa korrekta behörigheter, kontrollera vår guide om hur du fixar error i fil- och folderbehörigheter i WordPress.

Metod 8: Aktivera debug-läge

Ibland kan underliggande PHP error manifesteras som HTTP image upload error, vilket gör felsökningen svår.

Om du aktiverar debug-läget i din WordPress-konfiguration kommer alla PHP-fel att avslöjas i debug log, vilket ger värdefulla ledtrådar om grundorsaken till problemet med upload.

För instruktioner om hur du aktiverar WP_DEBUG-läget, se vår artikel om hur du aktiverar debug-läget i WordPress. Denna guide kommer att ge Step-by-Step instruktioner om hur du lägger till den nödvändiga koden i din wp-config.php-fil.

Metod 9: Kontrollera dina resurser för webbhotell

Om din website når sin lagringskvot eller stöter på limiter i serverns resurser kan det uppstå error vid upload. Till exempel kan otillräckligt diskutrymme hindra WordPress från att skapa nya filer eller foldrar som behövs för uppladdare av images.

De flesta hosting providers erbjuder en panel där du kan view your website’s resource usage, including disk space. Om du inte kan se det, kontakta supportteamet på din hosting provider för att få hjälp.

Om du närmar dig din limit för lagring bör du överväga att optimera dina resurser. Stora filer med images kan till exempel förbruka mycket lagringsutrymme. You can optimize your images to reduce their file size before uploading.

Om det inte räcker med att optimera resurserna kan du överväga att upgrading till ett webbhotell med mer lagringsutrymme. Detta ger den extra kapacitet som behövs för filerna på din website.

Om du letar efter en tillförlitlig WordPress hosting provider med generöst lagringsutrymme är Bluehost ett populärt alternativ. De erbjuder olika planer för att passa olika behov av websites.

Bluehost website

Vi hoppas att den här artikeln hjälpte dig att fixa HTTP image upload error i WordPress. Du kanske också vill se vår ultimata lista över de vanligaste WordPress-felen och hur man fixar dem, och de vanligaste problemen med Block Editor.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

175 kommentarerLämna ett svar

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. John

    not worked with any method

  3. Sandy

    I tried Option 3. Now my entire home page is blank. Individual pages are still there. The Sidebar is still visible, but the rest of the home page is blank.

    Please help if possible.

    Thank you,
    Sandy

    • WPBeginner Support

      You may want to ensure you didn’t change your homepage settings while troubleshooting and have you removed the code to see if that solved the missing content?

      Administratör

  4. Sanju

    Worked like charm Option 3.

    While My wordpress admin panel is slow.. Working on it. Any guide?

    • WPBeginner Support

      You may want to try disabling your plugins to see if one of your plugins could be slowing the admin area.

      Administratör

  5. Lucas Vidal

    Method #3 worked like a charm :)

    • WPBeginner Support

      Glad our guide could help :)

      Administratör

  6. Mounika

    Thank a lot ! 3rd option worked for me.

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  7. Rahana Razak

    Thank you sir, its working (3rd one worked for me)

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  8. Adriana

    Hello,
    I have tried all of them steps, and none has worked, I am not sure what else to do at this point , as i’m on limited time and would need this fixed , if any other ideas please do help. Thank you so much

    • WPBeginner Support

      You may want to reach out to your hosting provider to see if they see any errors on their end that could be causing the issue.

      Administratör

  9. Karan

    Thanks. It works by changing the default image file library.

    • WPBeginner Support

      Glad our article could help solve the issue :)

      Administratör

  10. SL101

    thank you so much, 3rd solution did the trick.

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  11. DrewDownz

    Number 3! Pow! Now lets hope in shows up in other browsers! :)

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  12. Salbin Sajan

    Hello brother… Thanks for your article ..

    #3 Solved the issue ..

    Thanks again ..

    • WPBeginner Support

      Glad our tutorial could help :)

      Administratör

  13. Tina

    Hi,

    thanks for this guide. Unfortunately, all these ideas did not work for me. Today, in an attempt to remove the ”website is on partially safe” SSL certificate message, I used ”Search and Replace” plugin to search my databases for ”http” and changed those to ”https”. That’s the only thing I could relate to this error, but since I am no expert on this, I don’t know how and if I can fix this or how I can undo these changes. Any help?

  14. kyle

    Hi i get the http error everytime i upload an image over 4mbs. I have contacted my web designer and host and they have both tried to load images over 15mbs and it is working for them. However, i have tried mulitple computers on different internet connections and i still get the http error. Can u please help?

  15. Hien

    I just wanted to comment, #3 definitely helped with 503 error/http error when uploading pictures sometime. Other time, upload pictures fine.

    • WPBeginner Support

      Thanks for sharing and glad our article could help resolve the issue :)

      Administratör

  16. rahul sharma

    Sir in the function.php where should i put the code??? {in the end or In the middle}

    • WPBeginner Support

      You would normally want to put added code at the end in case you need to edit or remove the code later

      Administratör

  17. Cindy

    Thank you so much! The third option worked for me!

    • WPBeginner Support

      Glad our guide could help :)

      Administratör

  18. Mike Gaudreau

    In my case, I simply logged out of the dashboard and right back in and the problem was cleared.

    • WPBeginner Support

      Thanks for sharing that, it sounds like either your caching had a hiccup or you ran into one of the server issues :)

      Administratör

  19. Mohamed

    You can’t imagine the level stress of this HTTP thing has created on me. Number 3 is my lifesaver. Thank you for posting this.

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  20. OA

    Thanks! Option 3 work for me. :D

    • WPBeginner Support

      Glad our recommendation worked :)

      Administratör

  21. Mohamed

    Thanks…Method 3 did it well

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  22. Janet

    I had about 10 pictures to upload and repeatedly got the HTTP error for 3 of them. I finally sussed that those three had an apostrophe in the file name!!! Doh! Removing the apostrophe was the solution.

    • WPBeginner Support

      Thanks for sharing your solution, glad you were able to get the files uploaded :)

      Administratör

  23. Hector

    Thanks, Number 3 did the trick. Awesome tutorial.

  24. Rae

    No. 3 worked for me too. Thank you for this!

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  25. Sandra

    Thanks for this! Number 3 fixed my problem :)

  26. William Davidson

    #2 worked for me. Easy peasy. Thanks for helping me fix it.

    • WPBeginner Support

      Hey William,

      Glad you found it helpful. Don’t forget to join us on Twitter for more WordPress tips and tutorials.

      Administratör

  27. Magloire

    This issue really stressed me up. No 3 solved my problem.

    Thanks

  28. Yann

    3 worked for me too. I copied right at the end of function.php in Appearance > editor of WordPress

  29. Eylene

    Hi there,

    Option 3 is working for me! Thank you so much this was driving me insane!!!

  30. Alissa

    Before I tried any of these solutions. I tried logging out of WordPress and logging back in, and suddenly I stopped getting the error message. So, you might want to try that first.

  31. Isla S

    I’ve noticed that this keeps happening to me with files that contain apostrophes in the filename. When I remove it, they upload fine

    Perhaps try to remove the ’ ?

    • Wanda

      THANK YOU! Removing the ’ worked for me :-)

  32. Andy

    Thank you! This was driving me crazy, had been trying to solve this for a friend for days

  33. Marek

    No. 3 works, thanks.

  34. Christina

    None of these worked for me. After some more researching, I found that putting this bit of code at the bottom of the .htaccess worked for me:

    # Exclude the file upload and WP CRON scripts from authentication

    Satisfy Any
    Order allow,deny
    Allow from all
    Deny from none

    Don’t forget to back up your .htaccess file first just in case!

  35. Savi Huang

    None worked. Pls help!

  36. NICOLE

    Number 4 worked for me!!! Thanks so much!

  37. Pat Smithers

    No. 3 worked a charm.

    Thank you so much!

  38. mike

    Please can will this solutions work on a localhost installation of wordpress?

    • WPBeginner Support

      These methods should work with localhost, the memory limit may need to be modified using the program for your server such as MAMP or WAMP

      Administratör

  39. Omar Ajruli

    Option number three fixed my problem guys, thank you. Have a great day.
    3. Change Image Editor Library Used by WordPress.

  40. Ali HyDer

    Its Working for me! Yuppiiiiiiiiiiiiiiiiii

    Thanks Syed Balkhi :)

  41. Emmanuel Usen Jackson

    My blog shows me ”An error occurred in the upload. Please try again later.”. Please what should I do?

    • Jake

      Try again later

  42. John

    Tried all to no avail UNTIL i added the code to the functions.php file. A BIG thank you!

  43. Dan

    Adding that line to my .htaccess file did the trick! Thanks!

  44. vishwas

    i did all the above changes in my site still image is not uploading, please help me to resolve this issue (http error)

  45. Casey

    THANK YOU! Changing the image editor worked for me.

  46. David

    For me, the issue was a series of pictures with an apostrophe in the title. Renamed and it worked fine.

  47. Tom Jaggard

    I need help resolving the HTTP error when uploading large files. Someone else created my site with an upload size limit of 64Mb. I am trying to upload audio files that are sometimes larger than 64Mb. I added a plug-in (Upload Max File Size) to change my max upload size to 128Mb. I changed memory_limit in PHP.ini to 256M. I change max_execution_time in PHP.ini to 300. I set memory_limit in wp-config to 256M. I changed memory_limit in .htaccess to 256M. I tried adding the code to .htaccess to force it to use the GD Library instead of Imagick. It didn’t work, so I remove that code and then added the line to limit Imagick to 1 thread. In spite of all of these changes, I still get the HTTP error when loading a file larger than 64Mb.
    Any more ideas?
    Thanks!

  48. siddharth pathak

    thanks a lot, I was trying to fix this from last 2 hour and after reading this article did it in just few sec and already tested thanks a lot

  49. Mauricio Lazo

    As a side note, another thing that can be giving you HTTP errors while uploading images is a configuration in you php.ini file, specifically the line ”max_execution_time=30;”.

    Some shared hosting providers limit PHP execution to a single core of the server, increasing the time it takes for PHP Imagick to get the image, process it and create thumbnails. So the suggestion is to increase max_execution_time to 120 seconds instead of the default 30 seconds.

  50. wassim jied

    Hello
    In my case

    function wpb_image_editor_default_to_gd( $editors ) {
    $gd_editor = ’WP_Image_Editor_GD’;
    $editors = array_diff( $editors, array( $gd_editor ) );
    array_unshift( $editors, $gd_editor );
    return $editors;
    }
    add_filter( ’wp_image_editors’, ’wpb_image_editor_default_to_gd’ );

    worked fine thanks

    Php Memory limit 128Mo v 7.13 apache 2.4

  51. Joost Walter

    One of the causes of an upload error is the fact that there is an apostrophe in the name of the file that you try to upload. For instance a picture called ’Let’s_dance.jpg’ will give an error, while ’Lets_dance.jpg’ can be uploaded without any problems.

    • Floz

      This was the problem in my case, thank you so much!! Saved me a lot of hassle ^_^

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.