Javascript Script Conversion

Convert some code to work with plupload script,
Here is the code portion in the working basic php script;
<script type=”text/javascript” src=”./getMIMEtype.js”></script>
<script type=”text/javascript”>
function setType(){
document.getElementById(“Content-Type”).value = getMIMEtype(document.getElementById(“file”).value);
}
</script>

it’s then set in the script by this;
<input type=”hidden” name=”Content-Type” id=”Content-Type” value=””>

File to upload :
<input name=”file” id=”file” type=”file”>
<br/><br/>
<input type=”submit” value=”Upload File to CDN” onClick=”setType()”>
</form>

I need to replicate the same in the attatched script, I think it applies here;
multipart_params: {
‘key’: ‘${filename}’, // use filename as a key
‘Filename’: ‘${filename}’, // adding this to keep consistency across the runtimes
‘acl’: ‘public-read’,
‘Content-Type’: ‘MIMETYPEHERE’,
‘success_action_status’: ‘201’,
‘AWSAccessKeyId’ : ‘<?php echo $accessKeyId; ?>’,
‘policy’: ‘<?php echo $policy; ?>’,
‘signature’: ‘<?php echo $signature; ?>’},

that is all – simple, hope you can help.

p.s there is more work if you can do it as seen in the image but this is the basic core of what I need & I think it’s very simple!

Leave a Reply

Your email address will not be published. Required fields are marked *