B
B
Bogdan Pasechnik2013-09-11 16:00:08
PHP
Bogdan Pasechnik, 2013-09-11 16:00:08

1C integration. Gives a cropped file

I do integration with 1C.
Here is a simplified code example

        $type=$_GET['type'];
        $mode=$_GET['mode'];

        if($mode=='init') {
            echo "zip=no\n";
            echo "file_limit=2000";
            exit;
        }

        if($mode=='checkauth') {
            // проверку на логин пароль убрал
            echo "success\n";
            echo session_name()."\n";
            echo session_id() ."\n";
            exit;
        }

       if($type=='catalog' && $mode=='file') {
            $content=file_get_contents('php://input');
            // и вот тут проблема описание выше
       }

       if($type=='sale' && $mode=='query') {
            // не существенно
        }

       if($type=='sale' && $mode=='file') {
            // не существенно
            echo 'success';
            exit;
       }


And when I receive data that transmits 1s through file_get_contents('php://input'); file text is truncated.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
alexhemp, 2013-09-11
@taral

> echo "file_limit=2000";
Try file_limit=0

K
kmm design, 2014-03-14
@kmm design

Or maybe like this

$f = fopen($dir.$filename, 'ab');
fwrite($f, file_get_contents('php://input'));
fclose($f);

$xml = simplexml_load_file($dir.$filename);

A
Alexander Kireev, 2015-02-20
@BespredeL

I also suffered with this 1s =))

$files = file_get_contents('php://input');
      
      if(!empty($files)){

        file_put_contents('data/'.$filename, $files, FILE_APPEND);
        echo "success\n";
      
      }

I did it this way =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question