Skip to content

LabArchives download of images is broken #35

@sgarrettroe

Description

@sgarrettroe

Uploading a png works, but trying to download it again doesn't. I am not sure what the issue is. Certainly writing the response as a binary file is not correct. The 29k png becomes a 29M file... maybe the data has already been interpreted by matlab? Do I need to know what the file is? how do I get that information?

laOptions.notebook = 'Test 1';
laOptions.folder = datestr(now,'yyyy');
laOptions.page = datestr(now,'yyyy-mm-dd');
laOptions.use_template = false;

LA = labarchivesCallObj(laOptions)

%% test upload
LA = LA.addAttachment('aFigure.png')
LA = LA.loadEntriesForPage;
LA = LA.dispEntriesForPage;
owd = pwd
%% test download (NOT WORKING)
cd test_downloads
LA = LA.downloadAttachments('aFigure.png');
cd(owd)
% see if it is a png or not

Doing the same with a mat file seems ok

LA = LA.addAttachment('aTesty.mat')
LA = LA.loadEntriesForPage;
LA = LA.dispEntriesForPage;

%% test download
cd('test_downloads')
LA = LA.downloadAttachments('aTesty.mat');
cd(owd)

mm = load('test_downloads/aTesty.mat')

% should return:
% mm = 
% 
%   struct with fields:
% 
%     atchOptions: [1×1 struct]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions