I have generated a table using the online generator and am now trying to adapt it so that I can upload a PDF file, but at the moment, it will only accept image uploads. Am I missing something.?
**PHP**
->upload( Upload::inst( $_SERVER['DOCUMENT_ROOT'].'/upload/__ID__.__EXTN__' )
->db( 'files', 'id', array(
'filename' => Upload::DB_FILE_NAME,
'filesize' => Upload::DB_FILE_SIZE,
'web_path' => Upload::DB_WEB_PATH,
'system_path' => Upload::DB_SYSTEM_PATH
) )
->validator( Validate::fileSize( 500000, 'Files must be smaller that 500K' ) )
->validator( Validate::fileExtensions( array( 'png', 'jpg', 'gif',pdf' ), "Please upload" ) )
)
)
->process( $_POST )
->json();
**JS**
{
data: "file",
render: function ( file_id ) {
return file_id ?
'<img src="'+editor.file( 'files', file_id ).web_path+'"/>' :
null;
},
defaultContent: "No image",
title: "Image"
}