refactor Storage to use getPathFrag
This commit is contained in:
parent
99d7037532
commit
1d8c55dc58
1 changed files with 10 additions and 9 deletions
|
|
@ -764,14 +764,13 @@ sub getPath {
|
||||||
$self->_addError("storage object malformed");
|
$self->_addError("storage object malformed");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
my $path = $self->session->config->get("uploadsPath")
|
my $path = $self->session->config->get("uploadsPath")
|
||||||
.'/'.$self->{_part1}
|
. '/'
|
||||||
.'/'.$self->{_part2}
|
. $self->getPathFrag();
|
||||||
.'/'.$id;
|
if (defined $file) {
|
||||||
if (defined $file) {
|
$path .= '/'.$file;
|
||||||
$path .= '/'.$file;
|
}
|
||||||
}
|
return $path;
|
||||||
return $path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -804,7 +803,9 @@ If specified, we'll return a URL to the file rather than the storage location.
|
||||||
sub getUrl {
|
sub getUrl {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $file = shift;
|
my $file = shift;
|
||||||
my $url = $self->session->config->get("uploadsURL").'/'.$self->{_part1}.'/'.$self->{_part2}.'/'.$self->getFileId;
|
my $url = $self->session->config->get("uploadsURL")
|
||||||
|
. '/'
|
||||||
|
. $self->getPathFrag;
|
||||||
if (defined $file) {
|
if (defined $file) {
|
||||||
$url .= '/'.$file;
|
$url .= '/'.$file;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue