Reply to ALLOW FILE UPLOADS...?

Your name:

Reply:


Posted by zapan@zapan.net ( on 08/13/05 03:27

hello,

sorry in advance if my question is naive.. i'm trying to allow file
uploads. optimally i'd like to store these files (jpgs, mostly) directly to
a folder in my httpdocs.. i've heard something about file uploads not being
allowed if server is set to safemode.. not sure why but i've been getting
errors.. here're the two files if you have time to check them out. thanks
for your time!

xo, -z
----------
[file1.html]

<form enctype="multipart/form-data"
action="file2.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="10000000">
FILENAME: <input name="filename1" type="file"><br><input type="submit"
value="submit"></form>


----------
[file2.php

<?php
$uploads_dir = '/release_pics/';
foreach ($_FILES as $myfile) {
$filename = $myfile['name'];
switch ($myfile['error']) {
case 4:
continue 2;
case 1:
case 2:
print "sorry, $filename is too big.<br>";
continue 2;
case 3:
print "the upload of file $filename was broken. please try again.<br>";
continue 2;
}
print "received: $filename.";
print "type: $myfile['type'].<br>";
move_uploaded_file(
$myfile['tmp_name'],
$uploads_dir.$myfile['name']);
}
?>


--

fourthcity 2005 ; slow yr roll. ---> http://www.fourthcity.net/


quick links:
> http://www.fourthcity.net/ [ fct]
> http://www.zapan.net/ [ zapan]
> http://www.laptopbattle.org/ [ battle]
> http://www.postermidget.com/ [ midget]


+
+
+
+ +
+
+


----> much love! from the fourthcity studios <----

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация