לא נפתר קוד לעתקת קבצים שלא עובד
-
<?php $playStop = $_GET['PlayStop']; $text = "1"; $pass = $_GET['pass']; $did = $_GET['ApiDID']; $ApiCallId = $_REQUEST['ApiCallId']; $add = $_REQUEST['add']; $what = $_REQUEST['what']; date_default_timezone_set('Asia/Jerusalem'); $time = date("Y-m-d-H-i-s"); $did = $_REQUEST['ApiDID']; $phone = $_REQUEST['ApiPhone']; $extension = $_REQUEST['ApiExtension']; $path2 = $_REQUEST['path2']; if ($pass == null) { print "read=t- הקישוא את סיסמת הניהול וסולמית לסיום=pass1,yes,,1,24,Digits,"; exit(); } $login = json_decode(file_get_contents("https://www.call2all.co.il/ym/api/Login?username={$did}&password={$pass}"), true); $stat = $login['responseStatus']; if ($stat != "OK") { print "id_list_message=t-שגיאה, יתכן ואחד מהפרטים שהקשתם שגויים, אנא נסו שוב בעוד חצי שעה .g-/"; exit(); } else { file_put_contents("{$ApiCallId}.wav", file_get_contents("https://www.call2all.co.il/ym/api/DownloadFile?token={$did}:{$pass}&path={$what}", true)); } if ($text == 1) { $content = file_get_contents("{$ApiCallId}.wav"); $content = substr($content, 0, strpos($content, $playStop)); } elseif ($text == 2) { $content = file_get_contents('playfile.wav'); $content = substr($content, strpos($content, $playStop)); } if ($path2 == null) { print "read=t- בחר את השלוחה אליה יעתיק=path2,,,0,14,Alpha,,,*/,"; exit(); } $obj = json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetIVR2DirStats?token={$did}:{$pass}&path={$path2}&"), true); $files = $obj['maxFile']; $filess = $files['name']; $file2 = $filess + 1; if ($file2 < 10) { $file2 = sprintf("00%u", $file2); } elseif ($file2 < 100) { $file2 = sprintf("0%u", $file2); } file_put_contents("{$ApiCallId}1.wav", $content); $token = "{$did}:{$pass}"; $path = "ivr2:/{$path2}/{$file2}.wav"; $YemotUrl = 'https://www.call2all.co.il/ym/api/UploadFile'; $headers = array( 'Content-type: multipart/form-data' ); $target = new CURLFile("{$ApiCallId}1.wav", 'media/wav'); $parm['upload'] = $target; $parm['token'] = $token; $parm['path'] = $path; $curl = curl_init(); curl_setopt_array( $curl, array( CURLOPT_URL => $YemotUrl, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $parm, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => true, ) ); $responsE = curl_exec($curl); curl_close($curl); $response = json_decode($responsE, TRUE); $status = $response['responseStatus']; if ($status == "OK") { unlink("{$ApiCallId}.wav"); file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token=$did:{$pass}&what=ivr2:{$path2}/{$file2}.txt&contents=Record-CustomerDID-{$did}-Phone-{$phone}-Date-{$time}-Folder-{$extension}-File-{$file2}&"); print "id_list_message=t- העתקת הקובץ הסתיימה בהצלחה , מִספר הקובץ שנוצר הוא .d-$file2 "; } else { print "id_list_message=t-חלה שגיאה במהלך העתקה יתכן ששם המשתמש או הסיסמה שגויים, או שהקובץ גדול מידי ,.g-/"; } ?>
לא עובד מישאו יכול לבדוק מה הבעיה
-
-
-
-
@רק-טוב עדיין צריך עזרה לגבי זה? במידה וכן תגיד לי בדיוק מה ברצונך לעשות?
-
@soris1989 כן עדיין צריך זה אמור להיות מודול שמבקש מספר מערכת סיסמה שממנה להעתיק מספר שלוחה ממנה להעתיק ומבקש מספר קובץ להעתקה לאיפה להעתיק מספר מערכת סיסמה שלוחה איליה יעתיק
-
@רק-טוב לא כ"כ הבנתי. אתה רוצה להעתיק לשלוחה מסויימת קבצים?
-
@soris1989 המודול המור לבקש מספר מערכת סיסמה שממנה להעתיק מספר שלוחה ממנה להעתיק ומבקש מספר קובץ להעתקה לאיפה להעתיק מספר מערכת סיסמה שלוחה איליה יעתיק ובימקום זה זה אומר אין מענה משרת הAPI