I’ve got a form that I would like to upload a video to AWS with Transloadit, and a text document to Salesforce without Transloadit. Is it possible to tell Transloadit to completely ignore the text document? Salesforce can handle the text document fine if we remove the video upload, but with the video it throws errors.
This is our assembly code.
{
"steps": {
"encode": {
"use": ":original",
"robot": "/video/encode",
"preset": "android",
"ffmpeg": {
"t": 180
},
"ffmpeg_stack": "v2.2.3"
},
"files": {
"use": ":original",
"robot": "/file/filter",
"accepts": [
[
"${file.mime}",
"regex",
"video"
],
[
"${file.mime}",
"regex",
"image"
]
],
"error_on_decline": true
},
"thumbs": {
"use": ":original",
"robot": "/video/thumbs",
"count": 1,
"width": 480,
"height": 320,
"ffmpeg_stack": "v2.2.3"
},
"export": {
"use": [
"encode",
"thumbs"
],
"robot": "/s3/xxxxx",
"key": "xxxxx",
"secret": "xxxxx",
"bucket": "xxxxx",
"bucket_region": "us-west-2",
"acl": "bucket-default",
"path": "${assembly.id}.${file.ext}"
}
}
}
And this is the custom code on our Form Assembly form
<script type='text/javascript'>
var ck = {};
ck.containerId = '#xxxxxL';
ck.hiddenId = '#xxxxx';
ck.submitSelector = "input[value='Complete Application']";
ck.hideSubmit = function() {
$(ck.submitSelector).prop('disabled', true)
.css('cursor', 'default')
.css('opacity', '0.5');
};
ck.showSubmit = function() {
$(ck.submitSelector).prop('disabled', false)
.css('cursor', 'pointer')
.css('opacity', '1');
};
ck.formSuccess = function() {
$('#video-upload').css('display', 'none');
$('#video-upload').val('');
$(ck.containerId).append(function() {
var htmlStr = '<div class="video-message"><div>Video Uploaded!</div>';
htmlStr += '<div id="video-reset">Reset</div></div>';
return htmlStr;
});
ck.showSubmit();
// Add event listener for reset link
$('#video-reset').click(function() {
ck.formReset();
});
};
ck.formReset = function() {
$('#video-upload').css('display', 'inline-block');
$('.video-message').remove();
ck.hideSubmit();
};
ck.initTransloadit = function(form) {
form.transloadit({
wait: true,
triggerUploadOnFileSelection: true,
debug: true,
autoSubmit: false,
maxNumberOfUploadedFiles: 2,
onSuccess: function(res) {
$(ck.hiddenId).val(res.assembly_id);
ck.formSuccess(form);
},
params: {
auth: {
key: 'xxxxx',
max_size: xxxxx
},
template_id: 'xxxxx'
}
});
ck.hideSubmit();
};
$(document).ready(function() {
var form = $('form');
// Check if video has already been uploaded
if ($(ck.hiddenId).val()) {
ck.formSuccess(form);
} else {
ck.initTransloadit(form);
}
});
</script>