0

Okay, I have a website project that opens and runs perfectly locally on Apache but when I have uploaded it to my WebServer I've found that the SVG files fail to load.

At first I believe this to be a problem with the content type but upon further investigation I can clearly see that it is set to image/svg+xml (which has always worked for me in the past).

I then checked the permissions for the files and even on 777 they still fail.

The status code returned is: 206 partial content.

failed load of svgs

I have googled this and have been going round in circles all day. Any insight as to the problem would be much appreciated.

Thanks in advance

TT

3
  • 2
    I have no problem with being penalised for asking a bad question if I have done so, but at least leave a comment so that I don't repeat the same mistake in future questions. Commented Oct 13, 2014 at 12:33
  • People will have been downvoting and/or voting to close because this question is not about programming. So is discouraged on Stack Overflow. Commented Oct 13, 2014 at 15:01
  • I did sway between putting this on here or server fault. As it could be htaccess solvable problem I thought here would be the better choice. Commented Oct 13, 2014 at 15:43

2 Answers 2

1

AFAIK, the 206 code is only sent by the server when the client (the browser) is requesting part of the file. So

How are you requesting the SVG files? Is it from javascript using AJAx etc? If so, check your requests are doing what they are supposed to.

Another possibility - according to question: What is 206 partial content is that it may be a cross domain issue.

2
  • i get the same result if i use the img tag, add the source inline or use a direct url. Commented Oct 13, 2014 at 15:39
  • 1
    You get an error if you inline the SVG in your HTML? Commented Oct 14, 2014 at 1:02
0

This issue has now been resolved.

Many thanks to BigBadaboom, whose input helped me turn my focus away from my HTML and .htaccess code and focus on refreshing the situation. My HTML and .htaccess turned out to be fine.

So I...

  1. removed all of the Content-Type/Encoding lines from the .htaccess file
  2. deleted all the SVG files from the server
  3. cleared the my local cache
  4. restarted my entire server
  5. uploaded the SVG files
  6. added the Content-Type/Encoding lines to the .htaccess file

and bingo it worked perfectly.

I had tried all of these steps previously in various combinations but it took all of them to get the files loading correctly.

Phew, I'm glad that is over.

Not the answer you're looking for? Browse other questions tagged or ask your own question.