Jump to content
Fórum Script Brasil
  • 0

Upload--


daniel_php

Question

Olá já postei esse problema aqui no forum ....

http://scriptbrasil.com.br/forum/index.php?showtopic=23898

...mas não consegui resolver, e também não tenho mais a quem recorrer..espero que me ajudem.

Uso Windows 2000 IIS 5.0 com php, MySql 1.4 para Win2000, já atribui todas as permisôes possiveis no IIS e não consigo mandar arquivos, e estou com o trabalho parado.

Vou postar o código e o erro:

CÓDIGO:

<?php

include('conn.php');

$modelo = $_POST['modelo'];

$preço = $_POST['preço'];

$descricao = $_POST['descricao'];

$foto = $_FILES['foto']['tmp_name'];

$updir = 'C:\Inetpub\wwwroot\sites\e-commerce\images';

if ($conn){

$inc = "INSERT INTO estoque (modelo,preço,descricao) VALUES ('$modelo','$preço','$descricao')";

$res = mysql_query($inc,$conn);

move_uploaded_file($foto,$updir);

}else {

echo "Erro na Conexão!";

}

?>

ERRO:

Warning: move_uploaded_file(C:\Inetpub\wwwroot\sites\e-commerce\images): failed to open stream: Permission denied in c:\inetpub\wwwroot\sites\velas\incluir_ok.php on line 13

Warning: move_uploaded_file(): Unable to move 'C:\PHP\uploadtemp\php561.tmp' to 'C:\Inetpub\wwwroot\sites\e-commerce\images' in c:\inetpub\wwwroot\sites\velas\incluir_ok.php on line 13

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Eu só achei essa parte do código no php.ini referente a upload, mas tá habilitado.

;;;;;;;;;;;;;;;;

; File Uploads ;

;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.

file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not

; specified).

upload_tmp_dir = C:\PHP\uploadtemp ; temporary directory for HTTP uploaded files (will use system default if not specified)

; Maximum allowed size for uploaded files.

upload_max_filesize = 2M

Link to comment
Share on other sites

  • 0

<?php

include('conn.php');

$modelo = $_POST['modelo'];

$preço = $_POST['preço'];

$descricao = $_POST['descricao'];

$foto = $_FILES['foto']['tmp_name'];

$arq_name = $_FILES["foto"]["name"];

$updir = 'C:\Inetpub\wwwroot\sites\e-commerce\images'.$arq_name;

if ($conn){

$inc = "INSERT INTO estoque (modelo,preço,descricao) VALUES ('$modelo','$preço','$descricao')";

$res = mysql_query($inc,$conn);

move_uploaded_file($foto,$updir);

}else {

echo "Erro na Conexão!";

}

?>

Tenta assim !!!

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.2k
    • Total Posts
      651.8k
×
×
  • Create New...