# Pdf onebox showing file size as 0 bytes

**URL:** https://meta.discourse.org/t/pdf-onebox-showing-file-size-as-0-bytes/67601
**Category:** Bug
**Created:** [7 Agosto , 2017 15:33 UTC](https://meta.discourse.org/t/pdf-onebox-showing-file-size-as-0-bytes/67601 "2017-08-07T15:33:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [7 Agosto , 2017 15:33 UTC](https://meta.discourse.org/t/pdf-onebox-showing-file-size-as-0-bytes/67601/1 "2017-08-07T15:33:15Z")

</div>

More a glitch than a bug, but anyway: URLs pointing to a pdf document are being oneboxed with a file size of 0 bytes. Otherwise the link works fine:

[https://dspace.lboro.ac.uk/dspace-jspui/bitstream/2134/14294/3/greiffenhagen-ca\_and\_consumption.pdf](https://dspace.lboro.ac.uk/dspace-jspui/bitstream/2134/14294/3/greiffenhagen-ca_and_consumption.pdf)

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [7 Agosto , 2017 16:55 UTC](https://meta.discourse.org/t/pdf-onebox-showing-file-size-as-0-bytes/67601/3 "2017-08-07T16:55:04Z")

</div>

I gave it a look.

```plaintext
➜ onebox git:(wrong-pdf-filesize) ✗ curl --head "https://dspace.lboro.ac.uk/dspace-jspui/bitstream/2134/14294/3/greiffenhagen-ca_and_consumption.pdf"

HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 16:59:03 GMT
Server: Apache/2.2.3 (Red Hat)
Expires: Mon, 07 Aug 2017 16:59:03 GMT
Content-disposition: inline; filename=greiffenhagen-ca_and_consumption.pdf
Connection: close
Content-Type: application/pdf

```

The HEAD request is not returning a “content-length” for this specific file, my 2 cents is that we should just hide file size when it happens and not try to be too fancy. What do you think @techAPJ?

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [7 Agosto , 2017 17:34 UTC](https://meta.discourse.org/t/pdf-onebox-showing-file-size-as-0-bytes/67601/4 "2017-08-07T17:34:25Z")

</div>

@techAPJ

I went ahead and created a PR following this idea, feel free to merge or delete.

[https://github.com/discourse/onebox/pull/368](https://github.com/discourse/onebox/pull/368)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [7 Agosto , 2017 18:36 UTC](https://meta.discourse.org/t/pdf-onebox-showing-file-size-as-0-bytes/67601/5 "2017-08-07T18:36:09Z")

</div>


