# XAR file is too large. Please choose files under 32.0 Mb

**URL:** <https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531>\
**Category:** Help / Discuss\
**Created:** [September 4, 2017, 6:39pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531 "2017-09-04T18:39:35Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerferra](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gerferra/32/242_2.png) [@gerferra](https://forum.xwiki.org/u/gerferra)\
**Post date:** [September 4, 2017, 6:39pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/1 "2017-09-04T18:39:35Z")

</div>

Hi.

I’m testing the `xwiki:9-mysql-tomcat` docker image, and I’m having problems importing large xar files.

The error is: _“The file xxx.xar is too large. Please choose files under 32.0 Mb”_.

Using the 8.4.5 image, I can import the file without problem.

I have already increased the attachment size limit and successfully attached the same xar file in the Sandbox page.

I’m thinking that maybe is a bug.

Is there a way to manually upload the file?

Thank you.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 4, 2017, 7:08pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/2 "2017-09-04T19:08:28Z")

</div>

AFAIK, there should be no difference between XWiki 9.x and 8.x regarding filesize attachment limits.

> [@gerferra](#):
>
> I have already increased the attachment size limit and successfully attached the same xar file in the Sandbox page.

So you can attach to a Sandbox page but not import in Admin UI? That’s strange indeed since importing in the Admin UI means attaching the file to a wiki page. Could you restart your wiki and try again to import the XAR?

Thanks

---

<div class="post-metadata">

**Author:** ![gerferra](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gerferra/32/242_2.png) [@gerferra](https://forum.xwiki.org/u/gerferra)\
**Post date:** [September 4, 2017, 7:22pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/3 "2017-09-04T19:22:14Z")

</div>

> [@vmassol](#):
>
> Could you restart your wiki and try again to import the XAR?

I tried but got the same error.

If I go to `Sandbox/#Attachments` and select the file to upload, I get the same error. In the previous test I was doing _drag and drop_ on the visual editor.

Maybe the two ways of uploading use different settings?

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 5, 2017, 5:36am UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/4 "2017-09-05T05:36:59Z")

</div>

> [@gerferra](#):
>
> If I go to Sandbox/#attachments and select the file to upload, I get the same error.

Ok, have you tried to increase the max upload size to a greater value?

You may also need to tell your DB about the max packet size, I know MySQL has a default value that may be too low (if you’re on mysql - See [http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationMySQL](http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationMySQL) and search for “packet”).

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 5, 2017, 5:37am UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/5 "2017-09-05T05:37:23Z")

</div>

Note that you could also switch to filesystem-based attachments, see [http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments](http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments)

---

<div class="post-metadata">

**Author:** ![gerferra](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gerferra/32/242_2.png) [@gerferra](https://forum.xwiki.org/u/gerferra)\
**Post date:** [September 5, 2017, 1:26pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/6 "2017-09-05T13:26:46Z")

</div>

> [@vmassol](#):
>
> Ok, have you tried to increase the max upload size to a greater value?

Yes, that’s the setting I mention in the OP that I have already increased. I’m using 268435456. I’ve followed this instructions [http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HSizeLimit](http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HSizeLimit)

> [@vmassol](#):
>
> Note that you could also switch to filesystem-based attachments

The docker image uses filesystem-based attachments by default. The only modification I have done to xwiki.cfg is to enable LDAP authentication.

> [@vmassol](#):
>
> You may also need to tell your DB about the max packet size

This still applies if I’m using filesystem-based attachments?

In case I have not been clear. I can upload large files (~100MB) if I use drag-and-drop on the graphical editor. I cannot upload large files using upload forms (tested with `XWikiPreferences?editor=globaladmin&section=Import` and `Sandbox/#Attachments`).

Is this expected? I would expect that the _Maximum Upload Size_ value to apply for both cases.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 5, 2017, 1:31pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/7 "2017-09-05T13:31:30Z")

</div>

> [@gerferra](#):
>
> Yes, that’s the setting I mention in the OP that I have already increased. I’m using 268435456. I’ve followed this instructions [http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HSizeLimit](http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HSizeLimit)

Yes I know you did that but I was mentioning a bigger value than you one you’ve used! 🙂

> [@gerferra](#):
>
> The docker image uses filesystem-based attachments by default. The only modification I have done to xwiki.cfg is to enable LDAP authentication.

Indeed I had forgotten that I put that by default!

> [@gerferra](#):
>
> This still applies if I’m using filesystem-based attachments?

Nope.

> [@gerferra](#):
>
> Is this expected? I would expect that the Maximum Upload Size value to apply for both cases.

It should. Again please try to increase the Maximum Upload Size value. What value did you put?

---

<div class="post-metadata">

**Author:** ![gerferra](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gerferra/32/242_2.png) [@gerferra](https://forum.xwiki.org/u/gerferra)\
**Post date:** [September 5, 2017, 1:36pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/8 "2017-09-05T13:36:50Z")

</div>

> [@vmassol](#):
>
> Again please try to increase the Maximum Upload Size value. What value did you put?

The default value is 33554432 (32MB). I’ve changed it to 268435456 (256MB).  
Is something wrong with this value? I’m a bit confused about you mentioning “a bigger value…”

I will try to update it again to a larger value to see if something changes.

---

<div class="post-metadata">

**Author:** ![gerferra](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gerferra/32/242_2.png) [@gerferra](https://forum.xwiki.org/u/gerferra)\
**Post date:** [September 5, 2017, 1:43pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/9 "2017-09-05T13:43:51Z")

</div>

Changing the value to 536870912 (512MB) haven’t produced any change. Will try again after a restart.

This incident [https://jira.xwiki.org/browse/XWIKI-12032](https://jira.xwiki.org/browse/XWIKI-12032) mentions that the browser may be caching some javascript related to upload. Will try clearing browser cache when xwiki restarts.

---

<div class="post-metadata">

**Author:** ![Pbas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/pbas/32/15_2.png) [@Pbas](https://forum.xwiki.org/u/Pbas)\
**Post date:** [September 5, 2017, 1:55pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/10 "2017-09-05T13:55:15Z")

</div>

Maybe you don’t have enough space anymore on your hard drive (or database emplacement)?  
Once I had this issue… 😉

---

<div class="post-metadata">

**Author:** ![gerferra](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gerferra/32/242_2.png) [@gerferra](https://forum.xwiki.org/u/gerferra)\
**Post date:** [September 5, 2017, 2:06pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/11 "2017-09-05T14:06:20Z")

</div>

> [@gerferra](#):
>
> the browser may be caching some javascript related to upload

Ok. Apparently this was the issue. After a forced refresh it let me do the upload 🙂

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 5, 2017, 2:40pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/12 "2017-09-05T14:40:59Z")

</div>

haha… had forgotten this and… but it seems documented at [http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HSizeLimit](http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HSizeLimit) 🙂 Guess we didn’t read it carefully enough!

---

<div class="post-metadata">

**Author:** ![gerferra](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gerferra/32/242_2.png) [@gerferra](https://forum.xwiki.org/u/gerferra)\
**Post date:** [September 5, 2017, 2:48pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/13 "2017-09-05T14:48:03Z")

</div>

> Note that if you’ve already tried to attach a file and it failed, in order for the new size setting to be taken into account you might need to clear your browser’s cache.

ha ha … 😱😅

Thanks for your time and support 🙂

---

<div class="post-metadata">

**Author:** ![gerferra](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gerferra/32/242_2.png) [@gerferra](https://forum.xwiki.org/u/gerferra)\
**Post date:** [September 5, 2017, 3:36pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/14 "2017-09-05T15:36:37Z")

</div>

> [@vmassol](#):
>
> Indeed I had forgotten that I put that by default!

Piggybacking on this. This default on the docker image means that the filesystem-based storage is the recomended storage for attachments? I have this impression by reading other documentation as well. It would be great if you can confirm that. Thanks.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 5, 2017, 7:31pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/15 "2017-09-05T19:31:04Z")

</div>

> [@gerferra](#):
>
> This default on the docker image means that the filesystem-based storage is the recomended storage for attachments?

Yes that’s correct. We need to make it the default for the non-docker installs too. The reason we haven’t done this sooner is because there are still [some known limitations](https://jira.xwiki.org/issues/?jql=component%20%3D%20%22Storage%20-%20File%20System%20Attachment%22%20AND%20project%20%3D%20XWIKI%20AND%20resolution%20%3D%20Unresolved%20ORDER%20BY%20priority%20DESC).

Since I’m the one who created the Docker distribution, I took the decision to configure filesystem attachments since I believe the issues it fixes are greater than the issue that still exist with it. I could be wrong though 🙂 and if you notice problems let us/me know!

Thanks

---

<div class="post-metadata">

**Author:** ![gerferra](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gerferra/32/242_2.png) [@gerferra](https://forum.xwiki.org/u/gerferra)\
**Post date:** [September 5, 2017, 7:47pm UTC](https://forum.xwiki.org/t/xar-file-is-too-large-please-choose-files-under-32-0-mb/531/16 "2017-09-05T19:47:03Z")

</div>

Will do. Thanks!
