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. Greg Zelt

    FANTASTIC!!! Every other search I did yielded nothing.

    Godaddy hosting with wordpress installed. Killing imagick did the trick. My lightroom plugin is functioning like a trooper now.

    Thank you so much, just had to share with you.

    • WPBeginner Support

      Glad our guide was able to help :)

      Administratör

  3. Felix

    Solution #3 works for me like a charm!

    • WPBeginner Support

      Glad our recommendation worked for you :)

      Administratör

  4. George

    Hi,
    I started having this HTTP uploading error for images that are larger than 600x900px . The size in KB doesn’t matter – 100KB or 300KB – they are uploading just fine if they are less then 600×900.

    I have tried all the methods you described without success.

    Do you think that changing the theme can help?

    • WPBeginner Support

      You would first want to reach out to your hosting provider to ensure you are not running into a safety measure from their end that would cause the error.

      Administratör

      • George

        Thanks!
        I called them before posting my question – they told me to contact WP support. To me, it also looks like they installed something on their server but are not willing to admit it.
        I’ll call again.

  5. fred david

    #3 worked for me too

    • WPBeginner Support

      Glad our recommendation worked for you :)

      Administratör

  6. Baskar

    The Option No.3 is giving perfect result. Thanks Bro !

    • WPBeginner Support

      Glad our recommendation was helpful :)

      Administratör

  7. Monique

    Instruction #3 worked for me. Thank you a bunch for this helpful documentation :)

    • WPBeginner Support

      You’re welcome, glad our guide could help :)

      Administratör

  8. edsbali

    Solution number 3 worked for me :)

    • WPBeginner Support

      Glad our recommendation was able to help :)

      Administratör

  9. DAMIAN

    The functions.php method worked for me. I’ve been trying to fix that for months! You saved me a lot of time. Thank you!!!

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  10. Almudena

    I have tried all the methods and none worked.

    • WPBeginner Support

      You would likely need to reach out to your hosting provider and they should be able to help solve the issue

      Administratör

  11. Stu

    The functions.php method worked for me. Thank you for solving a months old problem!

    • WPBeginner Support

      Glad our recommendation could help you solve the issue :)

      Administratör

  12. Ken Chan

    Thank you!! This was driving me crazy! #2 didn’t work but #4 did.

    • WPBeginner Support

      Glad our recommendation could help :)

      Administratör

  13. Joe

    Solution #3 work like a charm! <3

    • WPBeginner Support

      Glad our guide could help :)

      Administratör

  14. AG

    Tried all the above and no luck. My issue is only mp3 files, I get the http error. Contacted my hosting provider and they could find nothing wrong. Images upload fine. What am I missing?

    • WPBeginner Support

      For MP3 files you may need to increase the memory limit to 512 in case it is due to how large the files are

      Administratör

  15. Stacey

    Number 3 worked for me! Thank-you so much, that was so frustrating before. You’re site is always so helpful :)

    • WPBeginner Support

      Glad our guide could be helpful :)

      Administratör

  16. Mark R

    Thank you so much, I went through all four steps but nothing worked. I went back to step 1 and increased it from 256mb to 512mb which solved the problem.

    • WPBeginner Support

      Glad our guide could help be a part of the solution and you were able to get it resolved :)

      Administratör

  17. KKervin

    Option #3 worked for me to resolve the HTTP error.

    I installed the code snippets plugin and copied the code from here. It worked perfectly the first attempt.

    Thank you!

    • WPBeginner Support

      Glad our guide could help you :)

      Administratör

  18. yoeri

    Also just check the name of your image you want to upload.
    Make it simple as this has done the trick for me on multiple occasions.

    • WPBeginner Support

      Thanks for sharing what worked for you :)

      Administratör

    • Lee

      @Yoeri – Thank you, for me it was just the image name as you suggested, I simplified the name, (it had spaces)

  19. mohad ali

    can cloudflare cause this problem?????????????

    • WPBeginner Support

      While possible, it is not likely the root of the problem.

      Administratör

  20. Apurba

    Thanks. No 3 works for me. great tutorial man

    • WPBeginner Support

      Glad our guide could be helpful :)

      Administratör

  21. Honk the Honkler

    The .htaccess addition worked for me:
    SetEnv MAGICK_THREAD_LIMIT 1

    • WPBeginner Support

      Thanks for sharing the solution that worked for you :)

      Administratör

  22. Rory

    Another issue can be an apostrophe in the title i.e. dove’s it should be doves.

    • WPBeginner Support

      Thanks for sharing that recommendation to check :)

      Administratör

  23. Yatu

    None of the methods is working. Please help!

    • WPBeginner Support

      Have you reached out to your hosting provider to see if there are any errors on their end?

      Administratör

  24. Barri

    No 3 worked for me. thanks so much

    • WPBeginner Support

      Glad our guide could help :)

      Administratör

  25. Jen Niles

    None worked above and then we realize our dev site needed to change the Home and Site URL in General Settings in WP Admin from http:// to https:// then it worked! :D

    • WPBeginner Support

      Glad you were able to find the cause of the problem for your site :)

      Administratör

  26. Brian

    Thank you! #3 worked for me

    • WPBeginner Support

      Glad our recommendation could help :)

      Administratör

  27. Lloyd

    great!!! it worked well. Thank you

    • WPBeginner Support

      Glad our guide could help :)

      Administratör

  28. Marek

    None of these worked in my case. Mod security was the cause. I had to temporarily disable mod security on my web server.

    • WPBeginner Support

      Thanks for sharing what worked for you if other users run into this problem. For most users, they will need to reach our to their hosting provider for assistance in editing mod security

      Administratör

  29. Stephen

    #3 WORKED!!!!! THank you so much for your help!! Stupid go daddy…

    • WPBeginner Support

      Glad our recommendations could help :)

      Administratör

  30. JJ

    SOLVED: my pdf files that would not upload into the Word Press media library with HTTP Error had file names with a semi-colon in them. I deleted the semi-colon and it uploaded just fine. Semi-colons are legal characters in Word docs and pdf files, but apparently won’t upload to Word Press for reasons beyond my knowledge. ; ; ; ;

    • WPBeginner Support

      Thanks for sharing that solution for anyone else running into that problem :)

      Administratör

  31. Kat C

    You’re a lifesaver! #3 worked on an old Godaddy Legacy server. Thanks so much.

    • WPBeginner Support

      Glad our recommendation was helpful :)

      Administratör

  32. namagard

    the third one worked for me. thank you so much. ♥

    • WPBeginner Support

      Glad our recommendations could help :)

      Administratör

  33. Mark

    Thank you!!! it worked!!!

    • WPBeginner Support

      Glad our tutorial could help :)

      Administratör

  34. Westleboii

    None of these work for me. please help

    • WPBeginner Support

      If none of these methods worked, have you tried reaching out to your hosting provider to see if they can see an error on their end?

      Administratör

  35. Renée

    A combined 2 and 3 worked for me, thank you!

    • WPBeginner Support

      Awesome! Glad our solutions could help fix the problem :)

      Administratör

  36. PJ

    Setting GD as my preferred upload method worked for me.

    • WPBeginner Support

      Thanks for sharing which solution Worked for you :)

      Administratör

  37. Erin

    Method #4 worked for me. It seems my host was limiting the plugins processing power. Thanks for sharing these solutions.

    • WPBeginner Support

      Glad our guide could help :)

      Administratör

  38. Brad

    Another common problem for this is that you used an apostrophe in the file name. I just encountered this problem :)

    • WPBeginner Support

      Thanks for sharing what solved the problem for you :)

      Administratör

    • sarah

      Thank you! This was the simple fix I needed!

  39. Ruth

    Thanks a lot, it worked!

    • WPBeginner Support

      Glad our tutorial worked for you :)

      Administratör

  40. Shane

    Hi,

    Thanks a million for this. Method 3 worked for me.

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  41. LEGEND

    #3 is super

    • WPBeginner Support

      Thank you :)

      Administratör

  42. George R

    I have tried all the methods as mentioned above but none of these worked for me. So I contacted the service provider. They resolve the issue.
    They have refreshed and whitelist another IP for me and it works.
    Hope this may help for you too.

    • WPBeginner Support

      Thanks for sharing what worked for you :)

      Administratör

  43. Stuart

    Go into Jetpack and disable the CDN option was how I fixed mine.

    • WPBeginner Support

      Thanks for sharing your solution to this problem :)

      Administratör

  44. doun

    i have try all the methods above but still not working with me :(

    • WPBeginner Support

      Have you reached out to your hosting provider to ensure they don’t see any errors on their end?

      Administratör

  45. Ashok

    Thanks guys, it worked. Fantastic solution.

    • WPBeginner Support

      You’re welcome, glad our guide could help :)

      Administratör

  46. love

    don’t need to follow all step you just need to re-login your website and clear your temp files, that ok

    • WPBeginner Support

      For some people maybe, for others, they do require all of the steps in the article. :)

      Administratör

  47. Harsha D

    #3 works perfectly. Thank you wpbeginner team.

    • WPBeginner Support

      Glad our article could help :)

      Administratör

  48. Pawel Mansfeld

    OMG, I can’t believe! #3 works perfectly. Thank you for this tutorial!

    • WPBeginner Support

      Glad our article could help :)

      Administratör

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.