Jump to content

Archived

This topic is now archived and is closed to further replies.

Spixxx

File Uploader

Recommended Posts

My friend posted about this and said his post was gone the next day...so I helped him with $i++;, but he never got this answered, and Im using the same script...

[code]
<?php

$number="5";

$directory ="upload/";
if ($_POST){
for ($i=0;$i<$number;$i++){

if (trim($_FILES['myfiles']['name'][$i])!=""){

$newfile = $directory.$_FILES['myfiles']['name'][$i];

move_uploaded_file($_FILES['myfiles']['tmp_name'][$i], $newfile);

$j++;

}

}

}

if (isset($j)&&$j>0){

ACTION HERE

}

echo "<form method='post' enctype='multipart/form-data'>";


for($i=0;$i<$number;$i++){

echo "<input type='file' name='myfiles[]' size='30'><br>";}


echo "<input type='submit' name='action' value='Upload'>";

echo "</form>";

?>
[/code]

Few questions:

1) What would "ACTION HERE" be if I wanted to echo a _blank link to each of the newly uploaded files?
2) How could I make a form to specify a number 1-9, and use that in place of $number? And continue w/ rest of form
3) How could I make a dropdown with different directory names to upload the file(s) into? (i.e. ../images, .current folder, ../images/something)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.