[pve-devel] [PATCH storage 2/3] status: add new-filename to upload

Lorenz Stechauner l.stechauner at proxmox.com
Tue Jul 20 13:51:42 CEST 2021


Signed-off-by: Lorenz Stechauner <l.stechauner at proxmox.com>
---
 PVE/API2/Storage/Status.pm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm
index b549d7d..eac5e13 100644
--- a/PVE/API2/Storage/Status.pm
+++ b/PVE/API2/Storage/Status.pm
@@ -378,9 +378,15 @@ __PACKAGE__->register_method ({
 	    content => {
 		description => "Content type.",
 		type => 'string', format => 'pve-storage-content',
+		enum => ['iso', 'vztmpl'],
 	    },
 	    filename => {
-		description => "The name of the file to create.",
+		description => "The original name of the file.",
+		type => 'string',
+	    },
+	    'new-filename' => {
+		description => "The name of the file to create. Caution: This will be normalized!",
+		maxLength => 255,
 		type => 'string',
 	    },
 	    tmpfilename => {
@@ -414,7 +420,7 @@ __PACKAGE__->register_method ({
 	my $size = -s $tmpfilename;
 	die "temporary file '$tmpfilename' does not exist\n" if !defined($size);
 
-	my $filename = PVE::Storage::normalize_content_filename($param->{filename});
+	my $filename = PVE::Storage::normalize_content_filename($param->{'new-filename'});
 
 	my $path;
 
-- 
2.30.2






More information about the pve-devel mailing list