title: File upload using curl is not working
body: <p>I was trying to upload file using curl in symfony but uploading is not working, code is given below.</p>
  
  <pre><code>public function filePassingAction(Request $request, $guid) {
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, "http://192.168.0.41/lis/web/app_dev.php/interface/file-upload");
          curl_setopt($ch, CURLOPT_HEADER, false);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
          curl_setopt($ch, CURLOPT_POST, true);
          curl_setopt($ch, CURLOPT_POSTFIELDS, array(
              'file' =&gt; '@'.$this-&gt;getParameter('directory1').'/file.pdf',
          ));
          $result = curl_exec($ch);
          curl_close($ch);
          ($result);
          return new JsonResponse($result);
      }
  </code></pre>
  
  <p>receiving action</p>
  
  <pre><code>public function fileUploadAction(Request $request) {
          $file = $request-&gt;files-&gt;get('file');
          // Generate a unique name for the file before saving it
          $fileName = md5(uniqid()) . '.' . $file-&gt;guessExtension();
  
          // Move the file to the directory where brochures are stored
          $file-&gt;move(
                  $this-&gt;getParameter('directory2'), $fileName
          );
  
          return new JsonResponse();
      }
  </code></pre>
  
  <p>in service.yml</p>
  
  <pre><code>directory1: '%kernel.root_dir%/../web/uploads/directory1'
  directory2: '%kernel.root_dir%/../web/uploads/directory2'
  </code></pre>