Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[OT] un aiuto su (COPY) di php
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano
View previous topic :: View next topic  
Author Message
conte
n00b
n00b


Joined: 30 Nov 2003
Posts: 46

PostPosted: Mon Apr 12, 2004 1:07 pm    Post subject: [OT] un aiuto su (COPY) di php Reply with quote

Salve a tutti grazie a voi sto crescendo con gentoo e ne sono veramente contento :lol:
Un'altro quesito questavolta su php
allora sto cercando di fare dei script in php per spostare file nel server solo che mi sorge un problema
usando la funzione COPY di php mi sono accorto che funziona solo con file di piccole dimenzioni come supero i 700k non funge avete qualche consiglio ????

vi posto lo sriptino

<HTML>
<HEAD>
<TITLE>Handling File Uploads</TITLE>
</HEAD>
<BODY>
<?php
/* This next conditional determines whether or not to handle the form, depending upon whether or not $File exists. */
if ($File) {
print ("File name: $File_name<P>\n");
print ("File size: $File_size<P>\n");
if (copy ($File, "users/$File_name")) {
print ("Your file was successfully uploaded!<P>\n");
} else {
print ("Your file could not be copied.<P>\n");
}
unlink ($File);
}

print ("Upload a file to the server:\n");
print ("<FORM ACTION=\"FileUpload.php\" METHOD=POST ENCTYPE=\"multipart/form-data\">\n");
print ("File <INPUT TYPE=FILE NAME=\"File\" SIZE=20><BR>\n");
print ("<INPUT TYPE=SUBMIT NAME=\"SUBMIT\" VALUE=\"Submit!\"></FORM>\n");
?>
</BODY>
</HTML>

funge ma non so proprio dove mettermi le mani. nel file di conf di php non trovo nulla di utile grrazie :oops:
Back to top
View user's profile Send private message
kaosone
Guru
Guru


Joined: 01 Feb 2004
Posts: 446

PostPosted: Mon Apr 12, 2004 2:16 pm    Post subject: Reply with quote

nella pagina dove hai il form dove scegli il file devi mettere
<input type='hidden' name='MAX_FILE_SIZE' value='valore-che-vuoi'>
vado a memoria cmq spero sia giusto :!:
ah c'e' anche un limite di php che sistemi nel php.ini mi pare che di standard sia 2MB
Back to top
View user's profile Send private message
conte
n00b
n00b


Joined: 30 Nov 2003
Posts: 46

PostPosted: Mon Apr 12, 2004 8:53 pm    Post subject: Reply with quote

nulla aggiunta linea
e aumentato nel file php.in
riposto lo script

<HTML>
<HEAD>
<TITLE>Handling File Uploads</TITLE>
</HEAD>
<BODY>
<?php
/* This next conditional determines whether or not to handle the form, depending upon whether or not $File exists. */
if ($File) {
print ("File name: $File_name<P>\n");
print ("File size: $File_size<P>\n");
if (copy ($File, "users/$File_name")) {
print ("Your file was successfully uploaded!<P>\n");
} else {
print ("Your file could not be copied.<P>\n");
}
unlink ($File);
}

print ("Upload a file to the server:\n");
print ("<FORM ACTION=\"FileUpload.php\" METHOD=POST ENCTYPE=\"multipart/form-data\">\n");
print ("<INPUT TYPE=\"HIDDEN\" NAME=\"MAX_FILE_SIZE\" VALUE=\"200000\">\n");
print ("File <INPUT TYPE=FILE NAME=\"File\" ><BR>\n");
print ("<INPUT TYPE=SUBMIT NAME=\"SUBMIT\" VALUE=\"Submit!\"></FORM>\n")

?>
</BODY>
</HTML>

ma non riesco a capire
Back to top
View user's profile Send private message
kaosone
Guru
Guru


Joined: 01 Feb 2004
Posts: 446

PostPosted: Mon Apr 12, 2004 11:37 pm    Post subject: Reply with quote

se non sbaglio devi dividere per 1024 per avere il numero di kb che hai lasciato per l'upload... mi sembra un po' bassino quello che hai messo
cmq ripeto che vado a memoria molte cose potrebbero essere imprecise, ma il metodo e' quello :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum