Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
maarchRM
Commits
909fdb4b
Commit
909fdb4b
authored
Feb 26, 2020
by
Cyril Vazquez
Browse files
Merge branch 'fix/13343_Read_Resource_from_API' into 'Support/2.6.X'
Get size from temp file See merge request
!432
parents
7e9c0d8f
fe43bedd
Pipeline
#7039
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bundle/recordsManagement/Controller/archiveValidationTrait.php
View file @
909fdb4b
...
...
@@ -392,10 +392,6 @@ trait archiveValidationTrait
*/
public
function
validateDigitalResource
(
$digitalResource
)
{
if
(
$digitalResource
->
size
==
0
)
{
throw
new
\
bundle\recordsManagement\Exception\invalidArchiveException
(
'Resource size is null'
,
400
);
}
// Create temp file
$handler
=
$digitalResource
->
getHandler
();
$filename
=
tempnam
(
sys_get_temp_dir
(),
'digitalResource.format'
);
...
...
@@ -406,6 +402,10 @@ trait archiveValidationTrait
$digitalResource
->
size
=
filesize
(
$filename
);
if
(
$digitalResource
->
size
==
0
)
{
throw
new
\
bundle\recordsManagement\Exception\invalidArchiveException
(
'Resource size is null'
,
400
);
}
if
(
!
isset
(
$digitalResource
->
mimetype
))
{
$finfo
=
new
\
finfo
();
$mimetype
=
$finfo
->
file
(
$filename
,
FILEINFO_MIME_TYPE
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment