-
Notifications
You must be signed in to change notification settings - Fork 6
Uploading
To upload requires that you have a password on the Remote Data site. You can sign in using the credentialsDialog ...
rd = RdtClient('isetbio');
rd.credentialsDialog
This will bring up a window that asks you for your name and password. When you are credentialed, this rd object will remember that you are signed in.
We can upload a collection of files within a directory using the publishArtifacts function. In this approach, we place a collection of files in a local folder. We then specify the remote path where the files should be stored. The command to upload is 'publishArtifacts' (note the 's' at the end).
artifact = rd.publishArtifacts(fullPathFolder)
% ( ... 'remotePath', remotePath) remotePath instead of pwrp()
% ( ... 'version', version) version instead of default '1'
% ( ... 'type', type) restrict to type
You can place different file types within the folder, but only upload one type or another. For example, to upload the Matlab files in a local folder to a remote path, the general command might be
rd.crp('/your/upload/path');
fullPathFolder = fullfile(pwd,'localFolder');
rd.publishArtfacts(fullPathFolder,'type','mat');
Also, rather than using the rd.crp() command, you can specify the upload path as a parameter
rd.publishArtifacts(fullPathFolder,'remotePath','/isetbio/<remote path>');
Finally, if this is the 2nd version of the data you would like to upload, you can use
rd.publishArtifacts(fullPathFolder,'remotePath','/your/upload/path','version','2');
Note that the version is a string, not a number.
When you upload a file, you must specify the full file path and the remote path. In this case, use the publishArtifact command.
artifact = rd.publishArtifact(fullPathFile);
Note that there is no 's' at the end of publishArtifact. You can specify these parameter value pairs
% ( ... 'remotePath', remotePath) remotePath instead of pwrp()
% ( ... 'artifactId', artifactId) artifactId instead of name
% ( ... 'version', version) version instead of default '1'
Here is an example
rd.crp('/resources/data/istim');
fullPathFile = fullfile(pwd,'barMovie.mat');
artifact = rd.publishArtifact(fullPathFile);
which is equivalent to
fullPathFile = fullfile(pwd,'barMovie.mat');
artifact = rd.publishArtifact(fullPathFile,'remotePath','/resources/data/istim');