Upload Many

Upload Many

andreas.gebetsroither@sps.atandreas.gebetsroither@sps.at Posts: 6Questions: 4Answers: 0
edited November 2019 in Free community support

My Uploads didn't work anymore on PHP 7 and Postgres 11.

They work on PHP 5.

    ->join(
        Mjoin::inst( 'bewerber_upload' )
            ->link( 'bewerber.id', 'bewerber_files.bewerber_id' )
            ->link( 'bewerber_upload.id', 'bewerber_files.upload_id' )
            ->fields(
                Field::inst( 'id' )
                    ->upload( Upload::inst( UPLOADFOLDER.'__ID_____NAME__' )
                        ->db( 'bewerber_upload', 'id', array(
                            'file_name'    => Upload::DB_FILE_NAME, 
                            'file_size'    => Upload::DB_FILE_SIZE,
                            'web_path'    => Upload::DB_WEB_PATH,
                            'system_path' => Upload::DB_SYSTEM_PATH
                        ) )
                        ->validator( Validate::fileExtensions( array('jpeg', 'png', 'pdf', 'docx', 'xlsx', 'jpg', 'PDF', 'JPEG', 'PNG', 'DOCX', 'XLSX', 'JPG'), "Please upload an Document" ) )
                    )
            )
    )
{
                label: "PDF:",
                name: "bewerber_upload[].id",
                type: "uploadMany",
                display: function ( fileId, counter ) {
                    var filename = editor.file( 'bewerber_upload', fileId ).file_name;              
                    var endung = filename.substring(filename.length - 4, filename.length);         
                    endung = endung.replace('.',''); 
                    if(endung == "pdf"){
                        return '<a href="'+editor.file( 'bewerber_upload', fileId ).web_path+'" target="_blank" type="button"><img src="zusatz/pdf.png" width="100%" height="100%" /></a><p>'+filename+'</p>';
                    }
                    }
                },

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @andreas.gebetsroither@sps.at ,

    Can you give more information, please? Are you saying they used to work, but stopped? Did you do an update to some components? And what errors are you seeing, in the client and/or the server? Also, can you post the exchange between the client and the server when you do the upload?

    Cheers,

    Colin

  • andreas.gebetsroither@sps.atandreas.gebetsroither@sps.at Posts: 6Questions: 4Answers: 0

    They worked on PHP 5, now we have upgrade it to PHP 7 and now it stopped.

    I also tryed to upgrade the Editor folder from 1.9.0 to 1.9.2 but that didn't changed anything

    If i try to upload an file this Error comes:
    A server error occurred while uploading the file

    and everything worked bevor

  • tangerinetangerine Posts: 3,342Questions: 35Answers: 394

    What is the precise server error? Check your error logs.

  • andreas.gebetsroither@sps.atandreas.gebetsroither@sps.at Posts: 6Questions: 4Answers: 0

    where can i find them?

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    The most useful things are the things I asked for in my first message - client error, and the exchange between the server. The server error will depend on the server you have - check the webserver logs for any errors as a start...

This discussion has been closed.