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
https://forums.phpfreaks.com/topic/92084-upload-image/
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
https://forums.phpfreaks.com/topic/92084-upload-image/#findComment-471559
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
https://forums.phpfreaks.com/topic/92084-upload-image/#findComment-471576
Share on other sites

Archived

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

×
×
  • 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.