mirror of
https://github.com/LogicLabs-OU/OpenArchiver.git
synced 2026-04-06 00:31:57 +02:00
adding FRONTEND_BODY_SIZE_LIMIT to allow bigger file upload for the frontend. This is to fix the pst file upload error.
This commit is contained in:
@@ -33,6 +33,8 @@ REDIS_TLS_ENABLED=false
|
||||
# --- Storage Settings ---
|
||||
# Choose your storage backend. Valid options are 'local' or 's3'.
|
||||
STORAGE_TYPE=local
|
||||
# The maximum request body size to accept in bytes including while streaming. The body size can also be specified with a unit suffix for kilobytes (K), megabytes (M), or gigabytes (G). For example, 512K or 1M. Defaults to 512kb. Or the value of Infinity if you don't want any upload limit.
|
||||
FRONTEND_BODY_SIZE_LIMIT=100M
|
||||
|
||||
# --- Local Storage Settings ---
|
||||
# The path inside the container where files will be stored.
|
||||
|
||||
@@ -76,12 +76,11 @@
|
||||
method: 'POST',
|
||||
body: uploadFormData
|
||||
});
|
||||
|
||||
const result = await response.json();
|
||||
if (!response.ok) {
|
||||
throw new Error('File upload failed');
|
||||
throw new Error(`File upload failed + ${result}`);
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
formData.providerConfig.uploadedFilePath = result.filePath;
|
||||
formData.providerConfig.uploadedFileName = file.name;
|
||||
console.log(formData.providerConfig.uploadedFilePath);
|
||||
@@ -91,7 +90,7 @@
|
||||
setAlert({
|
||||
type: 'error',
|
||||
title: 'Upload Failed',
|
||||
message: 'PST file upload failed. Please try again.',
|
||||
message: 'PST file upload failed. Please try again.' + error.message,
|
||||
duration: 5000,
|
||||
show: true
|
||||
});
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import adapter from '@sveltejs/adapter-node';
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
|
||||
import 'dotenv/config';
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
// Consult https://svelte.dev/docs/kit/integrations
|
||||
// for more information about preprocessors
|
||||
preprocess: vitePreprocess(),
|
||||
kit: { adapter: adapter() }
|
||||
kit: {
|
||||
adapter: adapter({
|
||||
bodySizeLimit: process.env.FRONTEND_BODY_SIZE_LIMIT || '100M'
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user