Ir para conteúdo
Fórum Script Brasil
  • 0

Erro quando vai up video


jhonhyx

Pergunta

não envia o arquivo de video de modo algum..

<?

//$video = $_FILES['video']['name'];

$pasta = "videos"."/".$video_name;

if ($_GET['erro'] != 's' or $_GET['erro'] != 'ss') {

//move_uploaded_file($_FILES['video']['tmp'], $pasta);

if (!@copy($video,$pasta)) echo "<center>O arquivo não pode ser enviado!</center>";

else {

echo "<center>Vídeo enviado com sucesso!</center><p>";

}

?>

<html>

<head>

<title>Enviar Vídeo</title>

</head>

<body>

<div align="center">

<form action="salvar_dados.php" method="post" enctype="multipart/form-data" name="form1">

<table width="200" border="0" cellspacing="5">

<tr>

<td width="56"><div align="left"><strong>Empresa:</strong></div></td>

<td width="128"><div align="left">

<label>

<input name="empresa" type="text" id="empresa">

</label>

</div></td>

</tr>

<tr>

<td><div align="left"><strong>Telefone:</strong></div></td>

<td><div align="left">

<label>

<input name="telefone" type="text" id="telefone">

</label>

</div></td>

</tr>

<tr>

<td height="26"><div align="left"><strong>Foto:</strong></div></td>

<td><div align="left">

<label></label>

<input name="foto" type="file" id="foto">

</div></td>

</tr>

<tr>

<td><strong>Arquivo:</strong></td>

<td><div align="left">

<label></label>

<input name="arquivo" type="text" id="arquivo" value="<? echo $video_name; ?>" readonly="">

</div></td>

</tr>

<tr>

<td colspan="2"><div align="center">

<input type="submit" name="Submit" value="Enviar">

</div></td>

</tr>

</table>

</form>

</div>

</body>

</html>

<? } ?>

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

Quando é upload você deve utilizar move_uploaded_file e não copy, além disto, no copy você está utilizando a variável $video que está comentada, então nunca vai conseguir copiar de algum lugar ($video) que não existe.

Link para o comentário
Compartilhar em outros sites

  • 0

upload.php

<?

if ($_GET['erro'] == 's'){

echo "<center>Selecione um arquivo para proseguir!</center><p>";

}

if ($_GET['erro'] == 'ss'){

echo "<center>Campo(s) sem preenchimento! O processo deve ser reininciado.</center><p>";

}

if ($_GET['erro'] == 'sss'){

echo "<center>Foto não enviada! O processo deve ser reininciado.</center><p>";

}

?>

<html xmlns=http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Enviar V&iacute;deo</title>

</head>

<body>

<div align="center">

<form action="upload_file.php" method="post" enctype="multipart/form-data" name="form1" id="form1">

<table width="447" border="0" cellspacing="5">

<tr>

<td width="435" colspan="2"><div align="center"><strong>Selecione o v&iacute;deo para envio... </strong></div></td>

</tr>

<tr>

<td><div align="left">

<label></label>

</div>

<div align="center">

<input name="video" type="file" id="video" size="45" />

</div></td>

</tr>

<tr>

<td><div align="center">

<label>

<input type="submit" name="Submit" value="OK" />

</label>

</div></td>

</tr>

</table>

</form>

</div>

</body>

</html>

----------------------------------------upload_file.php-----

<?

//$video = $_FILES['video]['name'];

$pasta = "videos"."/".$video_name;

if ($_GET['erro'] != 's' or $_GET['erro'] != 'ss') {

//move_uploaded_file($_FILES['video']['tmp'], $pasta);

if (!@copy($video,$pasta)) echo "<center>O arquivo não pode ser enviado!</center>";

else {

echo "<center>Vídeo enviado com sucesso!</center><p>";

}

?>

<html>

<head>

<title>Enviar Vídeo</title>

</head>

<body>

<div align="center">

<form action="salvar_dados.php" method="post" enctype="multipart/form-data" name="form1">

<table width="200" border="0" cellspacing="5">

<tr>

<td width="56"><div align="left"><strong>Empresa:</strong></div></td>

<td width="128"><div align="left">

<label>

<input name="empresa" type="text" id="empresa">

</label>

</div></td>

</tr>

<tr>

<td><div align="left"><strong>Telefone:</strong></div></td>

<td><div align="left">

<label>

<input name="telefone" type="text" id="telefone">

</label>

</div></td>

</tr>

<tr>

<td height="26"><div align="left"><strong>Foto:</strong></div></td>

<td><div align="left">

<label></label>

<input name="foto" type="file" id="foto">

</div></td>

</tr>

<tr>

<td><strong>Arquivo:</strong></td>

<td><div align="left">

<label></label>

<input name="arquivo" type="text" id="arquivo" value="<? echo $video_name; ?>" readonly="">

</div></td>

</tr>

<tr>

<td colspan="2"><div align="center">

<input type="submit" name="Submit" value="Enviar">

</div></td>

</tr>

</table>

</form>

</div>

</body>

</html>

<? } ?>

Link para o comentário
Compartilhar em outros sites

  • 0

<? $video = $_FILES['video']['name'];

$pasta = "videos"."/".$video_name;

if ($_GET['erro'] != 's' or $_GET['erro'] != 'ss') {

move_uploaded_file($_FILES['video']['tmp'], $pasta);

if (!@copy($video,$pasta)) echo "<center>O arquivo não pode ser enviado!</center>";

else {

echo "<center>Vídeo enviado com sucesso!</center><p>";

}

?>

vou fazer um teste aqui .. acho q vai dar certo

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,4k
    • Posts
      652,2k
×
×
  • Criar Novo...