By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

file upload not working

P: n/a
Hello,

I'm having trouble uploading files via post method. I'm using this code for the form:

<form enctype="multipart/form-data" method="POST" action="run_dodaj_alb.php">
<p>Naziv albuma:<br><input type="text" name="naziv" size="35" value="<?php if (isset($row->naziv)) echo $row->naziv; ?>"></p>
<p>Godina izdanja: <input type="text" name="godina" size="4" value="<?php if (isset($row->godina)) echo $row->godina; ?>"></p>
<p>Slika:<br><input type="file" name="fajla"><br>
<?php if (isset($_POST['edit'])) { ?><input type="submit" name="Submit" value="Samo makni trenutacnu sliku"><?php } ?>
<input type="hidden" name="MAX_FILE_SIZE" value="500000"></p>
<?php
if (isset($_POST['edit'])) { ?>
<input type="hidden" name="edit" value="<?php echo $_POST['edit']; ?>">
<p><input type="submit" value="Uredi album"></p>
<?php } else { ?>
<p><input type="submit" value="Dodaj album"></p>
<?php }
?>
</form>

And this code for handling upload:
if ($_FILES['fajla']['name']!="") {
$slika="slike/" . $_FILES['fajla']['name'];
echo $_FILES['fajla']['tmp_name'] . "<br>";
move_uploaded_file($_FILES['fajla']['tmp_name'], "/home/users/n/nick/public_html/umzpa/rokeri/" . $slika);
//print_r($_FILES);
$slika="'" . $slika . "'";
} else $slika="NULL";

Now, the file doesn't get uploaded. Not to the $slika place, anyway. I searched
for the $_FILES['fajla']['tmp_name'] file, but it doesn't seem to be there. Where
do I start searching for the problem?

--
"Stara boljka se leci starim lekom...
Dabome vinom, ta nebi valjda mlekom?"
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mon, 21 Jun 2004 09:44:21 +0000, Nikola Skoric wrote:
Hello,

I'm having trouble uploading files via post method. I'm using this code for the form: <snip!> Now, the file doesn't get uploaded. Not to the $slika place, anyway. I searched
for the $_FILES['fajla']['tmp_name'] file, but it doesn't seem to be there. Where
do I start searching for the problem?


http://us4.php.net/features.file-upload

--
Jeffrey D. Silverman | jeffrey AT jhu DOT edu
Website | http://www.wse.jhu.edu/newtnotes/

Jul 17 '05 #2

P: n/a
Dana Mon, 21 Jun 2004 12:42:46 -0400,
Jeffrey Silverman <je*****@jhu.edu> kaze:
On Mon, 21 Jun 2004 09:44:21 +0000, Nikola Skoric wrote:
Hello,

I'm having trouble uploading files via post method. I'm using this code for the form:

<snip!>
Now, the file doesn't get uploaded. Not to the $slika place, anyway. I searched
for the $_FILES['fajla']['tmp_name'] file, but it doesn't seem to be there. Where
do I start searching for the problem?


http://us4.php.net/features.file-upload


Yes, yes, I copy/pasted the code from there and then edited it a little bit. But
it doesn't work...

--
"Stara boljka se leci starim lekom...
Dabome vinom, ta nebi valjda mlekom?"
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.