- Posts: 12509
- Thank you received: 2907
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $.post( 'https://www.myServer.de/myFiles/copyFile.php', { rid: "{SAVEDID}", sid: "{SID}", gid: "{Report.gid}", qid: "{Report.qid}" }) .done(function( data ) { }); }); </script>
<?php require_once 'meekrodb.class.php'; // I use this library to connect to MySQL DB::$error_handler=true; DB::$nonsql_error_handler=true; DB::$host='myHost'; DB::$user='myUser'; DB::$password='myPassword'; DB::$dbName='MyDB'; DB::$encoding='utf8'; $rid =$_POST['rid']; $sid =$_POST['sid']; $gid =$_POST['gid']; $qid =$_POST['qid']; $tbl_daten ='lime_survey_'.$sid; $col_files =$sid.'X'.$gid.'X'.$qid; $daten=DB::queryFirstRow("SELECT {$col_files} FROM {$tbl_daten} WHERE id={$rid}"); foreach ($daten[$x] as $key => $value) { $start=strpos($value,'fu_'); $ende=strpos($value,'"name')-2; $len=$ende-$start; $tmpfname=substr($value,$start,$len); $start=strpos($value,'"name')+8; $ende=strpos($value,'ext')-3; $len=$ende-$start; $orgfname=substr($value,$start,$len); if (!file_exists('../lime6/upload/surveys/'.$sid.'/files/'.$orgfname)) { copy('../lime6/upload/surveys/'.$sid.'/files/'.$tmpfname,'../lime6/upload/surveys/'.$sid.'/files/'.$orgfname); } } ?>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.