Hello guys,
I am developing a website on a platform called social script. I have an existing plugin which lets me upload pictures but i want to be able to also upload files if its possible?
I am not a developer and very much an amateur with this so please bare with me…
I have looked at my server and think i have found the correct file to change but unsure what exactly to change. ( I have added pdf,doc,docx,.msg,txt,wpd,wps,dat,xlr,xls,pif,,dwg,dxf,php’ to the file extensions but it hasnt worked. Is this a big task??
<? view::load(‘header’); ?>
<section class=”plugin-events plugin-pictures picture-upload”>
<?=view::load(‘system/elements/storage/upload’, array(
‘action’ => ‘events/pictures/upload/’.$eventID,
‘keyword’ => ‘event-picture’,
‘maxsize’ => config::item(‘picture_max_size’, ‘events’),
‘extensions’ => ‘jpg,jpeg,png,gif,pdf,doc,docx,.msg,txt,wpd,wps,dat,xlr,xls,pif,,dwg,dxf,php’,
‘limit’ => $limit,
‘review’ => true,
‘gallery’ => ‘assets/images/pictures/picture_none.jpg’,
‘onUpload’ => array(
‘function’ => ‘eventPictureFileUploaded’,
),
‘onComplete’ => array(
‘function’ => ‘eventPictureUploadCompleted’,
),
))?>
</section>
<script type=”text/javascript”>
function eventPictureFileUploaded(file, response)
{
$(‘#uploader-event-picture-files .file-‘ + file.id + ‘ img’).attr(‘src’, response.message.preview);
if ( typeof(response.message.delete) != ‘undefined’ )
{
$(‘#uploader-event-picture-files .file-‘ + file.id + ‘ .delete’).off(‘click’);
$(‘#uploader-event-picture-files .file-‘ + file.id + ‘ .delete’).click(function() {
runAjax(response.message.delete, {}, function(message){
$(‘#uploader-event-picture-files .file-‘ + file.id).remove();
}, null, ‘uploader-event-picture-files .file-‘ + file.id + ‘ .delete’, ‘icon-system-ajax’, null, null, function(){
$(‘#uploader-event-picture-files .file-‘ + file.id + ‘ .delete’).off(‘click’);
});
});
}
}
function eventPictureUploadCompleted(files, response)
{
$(‘#uploader-event-picture-continue’).prop(‘href’, ‘<?=config::siteURL(‘events/pictures/index/’ . $eventID)?>’);
$(‘#uploader-event-picture-continue’).show();
//window.location = ‘<?=config::siteURL(‘events/pictures/index/’ . $eventID)?>’;
}
</script>
<? view::load(‘footer’);