• הרשמה
    • התחברות
    • חיפוש
    • דף הבית
    • אינדקס קישורים
    • פוסטים אחרונים
    • קבלת התראות מהדפדפן
    • משתמשים
    • חיפוש בהגדרות המתקדמות
    • חיפוש גוגל בפורום
    • ניהול המערכת
    • ניהול המערכת - שרת private

    לא נפתר קוד לעתקת קבצים שלא עובד

    פורום PHP
    2
    5
    149
    טוען פוסטים נוספים
    • מהישן לחדש
    • מהחדש לישן
    • הכי הרבה הצבעות
    תגובה
    • הגיבו כנושא
    התחברו בכדי לפרסם תגובה
    נושא זה נמחק. רק משתמשים עם הרשאות מתאימות יוכלו לצפות בו.
    • ר
      רק טוב נערך לאחרונה על ידי רק טוב

      <?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-/";
      }
      
      
      ?>
      

      לא עובד מישאו יכול לבדוק מה הבעיה

      S תגובה 1 תגובה אחרונה תגובה ציטוט 0
      • נמחק על ידי  ר רק טוב 
      • שוחזר על ידי  ר רק טוב 
      • הנושא סומן כשאלה  ר רק טוב 
      • S
        soris1989 @רק טוב נערך לאחרונה על ידי soris1989

        @רק-טוב עדיין צריך עזרה לגבי זה? במידה וכן תגיד לי בדיוק מה ברצונך לעשות?

        ר תגובה 1 תגובה אחרונה תגובה ציטוט 0
        • ר
          רק טוב @soris1989 נערך לאחרונה על ידי

          @soris1989 כן עדיין צריך זה אמור להיות מודול שמבקש מספר מערכת סיסמה שממנה להעתיק מספר שלוחה ממנה להעתיק ומבקש מספר קובץ להעתקה לאיפה להעתיק מספר מערכת סיסמה שלוחה איליה יעתיק

          S תגובה 1 תגובה אחרונה תגובה ציטוט 0
          • S
            soris1989 @רק טוב נערך לאחרונה על ידי

            @רק-טוב לא כ"כ הבנתי. אתה רוצה להעתיק לשלוחה מסויימת קבצים?

            ר תגובה 1 תגובה אחרונה תגובה ציטוט 0
            • ר
              רק טוב @soris1989 נערך לאחרונה על ידי

              @soris1989 המודול המור לבקש מספר מערכת סיסמה שממנה להעתיק מספר שלוחה ממנה להעתיק ומבקש מספר קובץ להעתקה לאיפה להעתיק מספר מערכת סיסמה שלוחה איליה יעתיק ובימקום זה זה אומר אין מענה משרת הAPI

              תגובה 1 תגובה אחרונה תגובה ציטוט 0
              • פוסט ראשון
                פוסט אחרון