Jump to content
Fórum Script Brasil
  • 0

Download automático de video e upload em FTP


regiane cecilia Primoni

Question

2 answers to this question

Recommended Posts

  • 0

Eu consigo fazer o download direto para minha maquina, mas gostaria fazer o upload direto para um ftp

$file_name = 'video.mp4';
$file_url = 'video/' . $file_name;
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"".$file_name."\"");
readfile($file_url);
exit;
 
Link to comment
Share on other sites

  • 0

Achei isso com a Gemini:

<?php

// Verifica se o arquivo foi enviado
if (isset($_FILES['arquivo'])) {

  // Define o nome do arquivo
  $nomeArquivo = $_FILES['arquivo']['name'];

  // Define o local de destino
  $destino = "uploads/" . $nomeArquivo;

  // Move o arquivo para o destino
  if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $destino)) {
    echo "Arquivo salvo com sucesso!";
  } else {
    echo "Erro ao salvar o arquivo.";
  }
}

?>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      651.9k
×
×
  • Create New...