# SVG upload with CR/LF fails. Change to LF works

**URL:** <https://meta.discourse.org/t/svg-upload-with-cr-lf-fails-change-to-lf-works/120148>\
**Category:** Bug\
**Created:** [12 ביוני,‏ 2019,‏ 1:01pm UTC](https://meta.discourse.org/t/svg-upload-with-cr-lf-fails-change-to-lf-works/120148 "2019-06-12T13:01:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://meta.discourse.org/u/EricGT)\
**Post date:** [12 ביוני,‏ 2019,‏ 1:01pm UTC](https://meta.discourse.org/t/svg-upload-with-cr-lf-fails-change-to-lf-works/120148/1 "2019-06-12T13:01:06Z")

</div>

After reading

# [SVG corruption on download of local images](https://meta.discourse.org/t/svg-corruption-on-download-of-local-images/50081)

> It looks like the process of uploading is breaking the file, somehow. You can run a diff on the original I found on wikipedia: [https://upload.wikimedia.org/wikipedia/en/d/d2/Stitch\_(Lilo\_%26\_Stitch).svg](https://upload.wikimedia.org/wikipedia/en/d/d2/Stitch_%28Lilo_%26_Stitch%29.svg)
> 
> Doing so, it looks like removing linebreaks somehow busted this? The _data_ appears the same, but everything has been moved to a single line rather than being multi-line? Can anyone verify my analysis is correct here?

In testing this idea, copied a simple SVG created with GraphViz on Windows that contained CR (Carriage Return) and LF (Line Feed) and tried an upload. Received the error dialog:

> Sorry, but we couldn’t determine the size of the image. Maybe your image is corrupted?

Then using a text editor ([NotePad++](https://notepad-plus-plus.org/)) used the menu option `View -> Show Symbol -> Show All Characters` to see the line end characters; they were CR/LF. Changed them to LF, saved the file and uploaded. 😃

![ast_transformation_derivative_constant_after%20(linux)](https://global.discourse-cdn.com/meta/original/3X/e/b/eb11683cadcb6aa3e32e6758f5bfdfa96594819f.svg)

---

_[View the full topic](https://meta.discourse.org/t/svg-upload-with-cr-lf-fails-change-to-lf-works/120148)._
