Jump to content

File upload errors


jenycz

Recommended Posts

Hey Guys -

 

I'm using ajax upload so users can upload more than one file at a time. I'm using a test site right now to get things worked out - http://kooziebelt.com/test/upload/demos/demo-jquery.htm .

 

Here's the form...

<form action="../../../callup/upload.php" method="post">
		<p>Field 1 <input type="text" /></p>		
		<div>
			<input id="button3" type="file" />
		</div>
		<p>Uploaded files:</p>
		<ol class="files"></ol>
		<p>
			<input class="submit" type="submit" value="Submit form"/>	
		</p>
	</form>

 

Which calls this action...

<?php
$uploaddir = '../uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

if (move_uploaded_file($_FILES['userfile']['name'], $uploadfile)) {
  echo "success";
} else {
  // WARNING! DO NOT USE "FALSE" STRING AS A RESPONSE!
  // Otherwise onSubmit event will not be fired
  echo "It's entirely Eric's fault";
}
?>

 

The uploads file is in the root, so I'm pretty sure I'm directed right with ../uploads/ but again, not too sure.

 

Let me know if you need anything else, and other than that thank you in advance!

 

- Jack

 

 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

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.