Jump to content
Fórum Script Brasil
  • 0

Download automático de video e upload em FTP

regiane cecilia Primoni


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."\"");
Link to comment
Share on other sites

  • 0

Achei isso com a Gemini:


// 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.

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
    • Total Posts
  • Create New...