File Upload Hangs #823

Closed
opened 2026-10-05 00:19:20 +02:00 by adam · 11 comments
Owner

When I go to upload a file using the webform, nothing happens. The uploader just sits there and spins. I get the following error in the console.

Version 2.9.4

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data[Learn More]
jquery.min.js:5:15991
TypeError: uploadCategory is null[Learn More]

image

When I go to upload a file using the webform, nothing happens. The uploader just sits there and spins. I get the following error in the console. Version 2.9.4 ```javascript SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data[Learn More] jquery.min.js:5:15991 TypeError: uploadCategory is null[Learn More] ``` ![image](https://user-images.githubusercontent.com/11448029/44720169-f315b280-aa93-11e8-92b7-61c7ad6b9301.png) <!-- github-sync-id:354688328 -->
adam closed this issue 2026-10-05 00:19:20 +02:00
Author
Owner

I also have this problem.

I also have this problem. <!-- github-comment-id:416602534 -->
Author
Owner

Please use the developer console F12 to display the content of the json
response. Thank you

Le mar. 28 août 2018 à 16:19, autodonncha notifications@github.com a
écrit :

I also have this problem.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Piwigo/Piwigo/issues/920#issuecomment-416602534, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAs-jdDr6w9YP4EY-JZWhkVbOiUzHxvTks5uVVF0gaJpZM4WPbKZ
.

Please use the developer console F12 to display the content of the json response. Thank you Le mar. 28 août 2018 à 16:19, autodonncha <notifications@github.com> a écrit : > I also have this problem. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/Piwigo/Piwigo/issues/920#issuecomment-416602534>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AAs-jdDr6w9YP4EY-JZWhkVbOiUzHxvTks5uVVF0gaJpZM4WPbKZ> > . > <!-- github-comment-id:416603515 -->
Author
Owner

My console is showing this error:

VM220:1 Uncaught SyntaxError: Unexpected token p in JSON at position 1
at JSON.parse ()
at Function.m.parseJSON (jquery.min.js?v2.9.4:5)
at o.Uploader.FileUploaded (admin.php?page=photos_add:459)
at o.Uploader. (124w9x3.js:110)
at Array. (124w9x3.js:95)
at i (124w9x3.js:95)
at 124w9x3.js:95
at Array. (124w9x3.js:95)
at i (124w9x3.js:95)
at 124w9x3.js:95

My console is showing this error: VM220:1 Uncaught SyntaxError: Unexpected token p in JSON at position 1 at JSON.parse (<anonymous>) at Function.m.parseJSON (jquery.min.js?v2.9.4:5) at o.Uploader.FileUploaded (admin.php?page=photos_add:459) at o.Uploader.<anonymous> (124w9x3.js:110) at Array.<anonymous> (124w9x3.js:95) at i (124w9x3.js:95) at 124w9x3.js:95 at Array.<anonymous> (124w9x3.js:95) at i (124w9x3.js:95) at 124w9x3.js:95 <!-- github-comment-id:416606561 -->
Author
Owner

image

![image](https://user-images.githubusercontent.com/11448029/44729861-afc83d80-aaad-11e8-8102-dc09ddf2890f.png) <!-- github-comment-id:416608128 -->
Author
Owner

That's not the content. Check into the Network tab instead, the answer of
the json request

Le mar. 28 août 2018 à 16:34, William Hodges notifications@github.com a
écrit :

[image: image]
https://user-images.githubusercontent.com/11448029/44729861-afc83d80-aaad-11e8-8102-dc09ddf2890f.png

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Piwigo/Piwigo/issues/920#issuecomment-416608128, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAs-jbfhOi0ZdiMgyUKZcZc_XqY0VuLVks5uVVTjgaJpZM4WPbKZ
.

That's not the content. Check into the Network tab instead, the answer of the json request Le mar. 28 août 2018 à 16:34, William Hodges <notifications@github.com> a écrit : > [image: image] > <https://user-images.githubusercontent.com/11448029/44729861-afc83d80-aaad-11e8-8102-dc09ddf2890f.png> > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/Piwigo/Piwigo/issues/920#issuecomment-416608128>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AAs-jbfhOi0ZdiMgyUKZcZc_XqY0VuLVks5uVVTjgaJpZM4WPbKZ> > . > <!-- github-comment-id:416612376 -->
Author
Owner

Interesting, I'm getting the following:

Forbidden

You don't have permission to access /ws.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to 
use an ErrorDocument to handle the request.

Yet, the permissions are set to 777.

Interesting, I'm getting the following: ``` Forbidden You don't have permission to access /ws.php on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request. ``` Yet, the permissions are set to 777. <!-- github-comment-id:416622416 -->
Author
Owner

https://piwigo.org/forum/viewtopic.php?id=28837

Le mar. 28 août 2018 à 17:07, William Hodges notifications@github.com a
écrit :

Interesting, I'm getting the following:

Forbidden

You don't have permission to access /ws.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to
use an ErrorDocument to handle the request.

Yet, the permissions are set to 777.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Piwigo/Piwigo/issues/920#issuecomment-416622416, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAs-jd7zPIJvuzkTvySISeYO5EP1Y0Cpks5uVVywgaJpZM4WPbKZ
.

https://piwigo.org/forum/viewtopic.php?id=28837 Le mar. 28 août 2018 à 17:07, William Hodges <notifications@github.com> a écrit : > Interesting, I'm getting the following: > > Forbidden > > You don't have permission to access /ws.php on this server. > > Additionally, a 403 Forbidden error was encountered while trying to > use an ErrorDocument to handle the request. > > Yet, the permissions are set to 777. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/Piwigo/Piwigo/issues/920#issuecomment-416622416>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AAs-jd7zPIJvuzkTvySISeYO5EP1Y0Cpks5uVVywgaJpZM4WPbKZ> > . > <!-- github-comment-id:416630209 -->
Author
Owner

Ok I am getting:

[prepare_directory] cannot create directory ".//mnt/volume_lon1_02/2018/08/28"

In my conf:

$conf['upload_dir'] = '/mnt/volume_lon1_02';

I am using a volume to store images. Is that a problem from using an absolute path, or is that a permissions issue?

Thanks for your help.

Ok I am getting: [prepare_directory] cannot create directory ".//mnt/volume_lon1_02/2018/08/28" In my conf: $conf['upload_dir'] = '/mnt/volume_lon1_02'; I am using a volume to store images. Is that a problem from using an absolute path, or is that a permissions issue? Thanks for your help. <!-- github-comment-id:416631740 -->
Author
Owner

That's beyond my small knowledge of Linux and i don't know that part of
Piwigo, but could you use symlink instead of changing the setting?

Le mar. 28 août 2018 à 17:30, autodonncha notifications@github.com a
écrit :

Ok I am getting:

[prepare_directory] cannot create directory
".//mnt/volume_lon1_02/2018/08/28"

I am using a volume to store images. Is there a problem with using
absolute paths, or is that a permissions issue?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Piwigo/Piwigo/issues/920#issuecomment-416631740, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAs-jUxRDamj_gpdhe1G7ZSUiVD6KOXMks5uVWIugaJpZM4WPbKZ
.

That's beyond my small knowledge of Linux and i don't know that part of Piwigo, but could you use symlink instead of changing the setting? Le mar. 28 août 2018 à 17:30, autodonncha <notifications@github.com> a écrit : > Ok I am getting: > > [prepare_directory] cannot create directory > ".//mnt/volume_lon1_02/2018/08/28" > > I am using a volume to store images. Is there a problem with using > absolute paths, or is that a permissions issue? > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/Piwigo/Piwigo/issues/920#issuecomment-416631740>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AAs-jUxRDamj_gpdhe1G7ZSUiVD6KOXMks5uVWIugaJpZM4WPbKZ> > . > <!-- github-comment-id:416634189 -->
Author
Owner

I figured it out. For me, it was caused by the absolute path. It must be relative, as the comment above the setting says.

I needed to use:

$conf['upload_dir'] = '../../../mnt/volume_lon1_02';

Thanks for your help

I figured it out. For me, it was caused by the absolute path. It must be relative, as the comment above the setting says. I needed to use: $conf['upload_dir'] = '../../../mnt/volume_lon1_02'; Thanks for your help <!-- github-comment-id:416634470 -->
Author
Owner

Hm, I have a similar problem (piwigo 2.9.4). I see there's an attempt to upload files in upload/buffer : .part files are created with 0 length, but that's it. I see no error in logs.

Files are ~1-3MB, I verified I can upload files with small php script.

EDIT: I spawned a VM and installed it on vanilla system -- it works without problem. So probably something in my configuration is causing a problem. FYI: It's a FreeBSD 11.2, apache24/php71/mysql56 running inside jail.

PHP does have a permission to upload (tested by my small php script), so I'm obviously missing something ..

EDIT2: I'm updating the answer just in case somebody else has the same problem. In php.ini, among other things, I've upload_tmp_dir set to non-standard directory. For this reason I had to update open_basedir to include this dir in the path.

Hm, I have a similar problem (piwigo 2.9.4). I see there's an attempt to upload files in upload/buffer : .part files are created with 0 length, but that's it. I see no error in logs. Files are ~1-3MB, I verified I can upload files with small php script. EDIT: I spawned a VM and installed it on vanilla system -- it works without problem. So probably something in my configuration is causing a problem. FYI: It's a FreeBSD 11.2, apache24/php71/mysql56 running inside jail. PHP does have a permission to upload (tested by my small php script), so I'm obviously missing something .. EDIT2: I'm updating the answer just in case somebody else has the same problem. In php.ini, among other things, I've `upload_tmp_dir` set to non-standard directory. For this reason I had to update `open_basedir` to include this dir in the path. <!-- github-comment-id:433705962 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#823