Reduce chunk size from 1MB to 512KB for nginx compatibility

The nginx proxy was returning 413 (Request Entity Too Large) errors for
1MB chunks. Reduced chunk size to 512KB to work with common nginx
client_max_body_size configurations.

Note: For production, the nginx configuration should also be updated to
allow larger request bodies:
  client_max_body_size 100M;
parent 6b8f0ba1
...@@ -558,7 +558,7 @@ ...@@ -558,7 +558,7 @@
return fetch(buildUrl(path), options); return fetch(buildUrl(path), options);
} }
const CHUNK_SIZE = 1024 * 1024; // 1MB chunks const CHUNK_SIZE = 512 * 1024; // 512KB chunks (smaller for nginx compatibility)
let activeUploads = new Map(); let activeUploads = new Map();
function uploadFileInChunks(file, matchId) { function uploadFileInChunks(file, matchId) {
......
...@@ -791,7 +791,7 @@ ...@@ -791,7 +791,7 @@
} }
// ZIP Upload Functions // ZIP Upload Functions
const CHUNK_SIZE = 1024 * 1024; // 1MB chunks const CHUNK_SIZE = 512 * 1024; // 512KB chunks (smaller for nginx compatibility)
function uploadFileInChunks(file, matchId) { function uploadFileInChunks(file, matchId) {
const totalChunks = Math.ceil(file.size / CHUNK_SIZE); const totalChunks = Math.ceil(file.size / CHUNK_SIZE);
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
return fetch(buildUrl(path), options); return fetch(buildUrl(path), options);
} }
const CHUNK_SIZE = 1024 * 1024; // 1MB chunks const CHUNK_SIZE = 512 * 1024; // 512KB chunks (smaller for nginx compatibility)
function uploadFileInChunks(file, matchId) { function uploadFileInChunks(file, matchId) {
const totalChunks = Math.ceil(file.size / CHUNK_SIZE); const totalChunks = Math.ceil(file.size / CHUNK_SIZE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment