Jump to content

Upload Image


stublackett

Recommended Posts

Hi,

 

I've got a script setup that collects the data submitted from the form

 

The problem I've got is the image is just not going to the specified Folder

 

The echo of $upfile I've got in the script is putting the image in /ideas/imagename.jpg

 

But the Image is just not copying over

 

Any ideas??

<?php #Script idea-submit.php 
//Collect Forms' Post Values
$title = $_POST['title'];
$description = $_POST['description'];
$category = $_POST['category'];
$img = $_FILES['image']['name'];

//Validation Check
//Check Ideas' Title
if (!empty($_POST['title'])) {
$title = ($_POST['title']);
}else{
$title = NULL;
echo "<p>You need to enter your ideas' title</p>";
}

//Check Description
if (!empty($_POST['description'])) {
$description = ($_POST['description']);
}else{
$description = NULL;
echo "<p>You need to enter your ideas' description </p>";
}
//Hanlde the Image
$upfile = '/ideas/' .$_FILES['image']['name'] ;

if (is_uploaded_file($_FILES['image']['tmpname']))
{
if (!move_uploaded_file($_FILES['image']['tmpname'], $upfile))
{
	echo 'Problem : Could not move file to destination directory';
	exit;
}
}else{
	echo 'File Uploaded Succesfully<br><br>';
	echo $upfile;

Link to comment
Share on other sites

Still no joy there either  >:( >:(

I was thinking it might just be down to the localhost settings, But I've tried again on the web and nothing

 

Strange thing is though that the echo statement is actually outputting exactly where the file should be, Its just the Upload is definatley not going through

 

"ideas/score.JPG"

 

Being an example

Link to comment
Share on other sites

Just to confirm, are you getting the message "File Uploaded Succesfully" right?

 

Yeah the script is executing right the way down to "File Uploaded Succesfully"

But its just not putting that file into the folder

 

and the echo statement is definatley the folder I'd like it to go to

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.