[Loris-dev] Imaging Uploader Failing File Verification

Nicolas Brossard nicolasbrossard.mni at gmail.com
Fri Jul 24 13:18:44 EDT 2020


Hi Eli,

If you have specified a value for TMPDIR in your environment file, you
should also set the value of variable upload_tmp_dir in your php.ini file,
otherwise the uploader will still use the default system temporary
directory (usually /tmp, which most often than not has limited space).

On Fri, Jul 24, 2020 at 12:26 PM Eli Johnson <joh17964 at umn.edu> wrote:

> Hi Nicolas,
>
> I do have a custom path for TMPDIR set in the environment file and I have
> confirmed that the directory is writable (by user apache in this case since
> OS is RHEL) and has plenty of space.
>
> Where do I find what the upload error code number indicates? I saw that it
> was 7 but couldn't find where it was being set or what it meant.
>
> Any other recommendations for debugging this? The error log is sparse and
> not particularly helpful here. Should I still be looking in
> imaging_uploader.class.inc or is this an issue that begins in a parent
> library (ie File_Upload.class.inc)?
>
> Best,
> Eli
>
> Eli Johnson
> Developer/Researcher
> Institute of Child Development
> University of Minnesota
> joh17964 at umn.edu
>
>
> On Fri, Jul 24, 2020 at 11:03 AM Nicolas Brossard <
> nicolasbrossard.mni at gmail.com> wrote:
>
>> Hi Eli,
>>
>> Looking at what is being passed to $file->setHandlerArgs, I can see that
>> the upload error code is set to 7, which means that the system could not
>> copy your file in the temporary directory dedicated to uploading files on
>> the server. By default, uploaded files are written in /tmp, but you can
>> override this by setting variable TMPDIR in <LORIS_MRI_ROOT>/environment.
>> I would check that whichever directory you are uploading to has enough free
>> space to allow the upload and that user www-data has write permission on
>> that directory.
>>
>> Let me know if that fixes the issue.
>>
>> Best,
>> Nicolas
>>
>> On Thu, Jul 23, 2020 at 11:50 PM Eli Johnson <joh17964 at umn.edu> wrote:
>>
>>> Hi,
>>>
>>> Using LORIS v23.0 on RHEL 7, accessing LORIS front end from Chrome.
>>>
>>> I'm currently setting up the LORIS-MRI and imaging modules for LORIS. I
>>> am running into an issue with the Imaging Uploader on the front end where
>>> it is returning the error message "The file TEST111_986793_testing1.zip
>>> is not of type .tgz, .tar.gz or .zip." When checking the error-log from
>>> the back end I'm seeing...
>>>
>>> PHP Warning:  mime_content_type(): Empty filename or path in
>>> /<basepath>/modules/imaging_uploader/php/imaging_uploader.class.inc on line
>>> 646, referer: http://<site>/imaging_uploader
>>>
>>>
>>> Upon further investigation into imaging_uploader.class.inc, the function
>>> isCompressed() is being passed an empty string from isValid(). IsValid is
>>> passing it $temp_file, defined in $temp_file=$file->fileInfo['tmp_name'],
>>> but this is also an empty string. So I'm trying to figure out at what stage
>>> 'tmp_name' should be defined for $file->fileInfo but I am struggling to
>>> track it down. I checked what was being passed in $file->setHandlerArgs and
>>> it contains this:
>>>
>>> Array
>>> (
>>>     [IsPhantom] => N
>>>     [candID] => 986793
>>>     [pSCID] => TEST111
>>>     [visitLabel] => testing1
>>>     [mriFile] => Array
>>>         (
>>>             [name] => TEST111_986793_testing1.zip
>>>             [type] =>
>>>             [tmp_name] =>
>>>             [error] => 7
>>>             [size] => 0
>>>         )
>>> )
>>>
>>>
>>> Any suggestions on how to get the uploader working? I have verified that
>>> the MRIUploadIncomingPath variable is set appropriately and is an existing,
>>> writable directory. I also am able to successfully upload the same zip file
>>> from the back end.
>>>
>>>
>>> Thanks,
>>> Eli
>>>
>>>
>>> Eli Johnson
>>> Developer/Researcher
>>> Institute of Child Development
>>> University of Minnesota
>>> joh17964 at umn.edu
>>> _______________________________________________
>>> Loris-dev mailing list
>>> Loris-dev at bic.mni.mcgill.ca
>>> https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20200724/64e76356/attachment-0001.html>


More information about the Loris-dev mailing list