Commit f55dda1
committed
fix(uploadservice): preserve path for S3 upload with subdirs
`path.basename(filename)` strips as well the relative path from the filename, which breaks the ability to upload to S3 buckets with subdirectories included via slashes in the filename input.
This commit takes the logic from the base upload_file method to preserve the correct relative path if subdirectories shall be included, stripping away possible leading slashes, which was another issue that could appear.
Additionally, the leading slashes are now `lstrip`ped from the path, instead of using a while loop, simplifying code, and the debug message now shows the path the file is uploaded to.
Signed-off-by: MichaIng <micha@dietpi.com>1 parent 5c0b7da commit f55dda1
1 file changed
+13
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 64 | + | |
68 | 65 | | |
69 | 66 | | |
70 | 67 | | |
| |||
1221 | 1218 | | |
1222 | 1219 | | |
1223 | 1220 | | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1224 | 1229 | | |
1225 | 1230 | | |
1226 | | - | |
1227 | | - | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1228 | 1235 | | |
1229 | 1236 | | |
1230 | 1237 | | |
| |||
0 commit comments