October 23, 2024
Chicago 12, Melborne City, USA
PHP

Send file contents to RabbitMQ


Here is my code to send file content to queue:

$documentToSend = ['file' => file_get_contents($filePath)];

Queue calling:

Queue::pushRaw(json_encode($documentToSend), 'service-call');

Here is my queue handle:

public function handle(){
     
  try {
      $file = $this->data->file;
      Storage::disk()->put($fileToPath, $file, 'public');
   } catch (Exception $e) {
      Log::error($e);
   }

}

Getting noting in error and nor in data.

Can anyone guild me?

Thanks.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video