Made file upload use the Form API instead of the Storage API due to name hacks

This commit is contained in:
Colin Kuskie 2007-03-06 03:43:48 +00:00
parent 6f441d69c3
commit 57fc140369
5 changed files with 15 additions and 12 deletions

View file

@ -700,13 +700,18 @@ sub www_editListingSave {
##This is a hack. File upload should go throught the WebGUI::Form::File API
##so that future changes don't affect us like this
my $screenshot = $storage->addFileFromFormPost("screenshot_file");
my $screenshotStorageId = WebGUI::Form::File->new($self->session,{name => 'screenshot'})->getValueFromPost;
my $uploadedScreenshot = WebGUI::Storage->get($self->session, $screenshotStorageId);
my $screenshot = $uploadedScreenshot->addFileFromFormPost("screenshot");
if (defined $screenshot) {
$data{filename} = $screenshot;
$storage->generateThumbnail($screenshot);
$storage->addFileFromFilesystem($uploadedScreenshot->getPath($screenshot));
}
$uploadedScreenshot->delete;
my $productName = $self->session->form->process("productName");
my $isNew = 0;