diff --git a/b0esche_cloud/lib/services/file_service.dart b/b0esche_cloud/lib/services/file_service.dart
index 5037296..6bad05c 100644
--- a/b0esche_cloud/lib/services/file_service.dart
+++ b/b0esche_cloud/lib/services/file_service.dart
@@ -258,19 +258,9 @@ class FileService {
// Generate minimal valid DOCX file (Office Open XML format)
final bytes = _generateEmptyDocx();
- // Construct proper path
- String fullPath;
- if (parentPath == '/') {
- fullPath = '/$docxName';
- } else {
- final cleanParent = parentPath.endsWith('/')
- ? parentPath.substring(0, parentPath.length - 1)
- : parentPath;
- fullPath = '$cleanParent/$docxName';
- }
-
+ // Send parent directory as 'path' parameter
final formData = FormData.fromMap({
- 'path': fullPath,
+ 'path': parentPath,
'file': MultipartFile.fromBytes(bytes, filename: docxName),
});
@@ -296,6 +286,7 @@ class FileService {
+
''';
archive.addFile(
ArchiveFile(
@@ -321,13 +312,17 @@ class FileService {
// word/document.xml - the actual document content (empty)
const documentXml =
'''
-
+
-
-
-
+
+
+
+
+
+
+
''';
archive.addFile(
@@ -338,6 +333,46 @@ class FileService {
),
);
+ // word/styles.xml - document styles
+ const stylesXml = '''
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+''';
+ archive.addFile(
+ ArchiveFile(
+ 'word/styles.xml',
+ stylesXml.length,
+ Uint8List.fromList(stylesXml.codeUnits),
+ ),
+ );
+
// word/_rels/document.xml.rels - document relationships (empty but required)
const docRels = '''