kev_120 Posted September 16, 2007 Share Posted September 16, 2007 Hey there, I'm having a PHP problem. Whenever I use the $_FILES superglobal to upload files via a form, it never seems to work when I run it on any Windows system. However, when I run it on my Mac, the image uploads just fine with the same script. What could the problem be? Thanks! Link to comment https://forums.phpfreaks.com/topic/69568-_files-does-not-work-on-windows/ Share on other sites More sharing options...
zq29 Posted September 16, 2007 Share Posted September 16, 2007 Code? Link to comment https://forums.phpfreaks.com/topic/69568-_files-does-not-work-on-windows/#findComment-349590 Share on other sites More sharing options...
kev_120 Posted September 18, 2007 Author Share Posted September 18, 2007 <? include 'http://www.faithum.org/header.php'; if (isset($_POST['submit'])) { echo '<span style="float:left;">'; $path = getcwd(); define("IMAGEREPOSITORY",$path, true); if (is_uploaded_file($_FILES['image']['tmp_name'])) { $imageresult = move_uploaded_file($_FILES['image']['tmp_name'], IMAGEREPOSITORY.$_FILES['image']['name']); } if ($imageresult) { echo "Image posted successfully!<br>"; } else { echo "<font color=red>Image posting error!</font><br>"; } include 'news.connect.php'; $name = $_POST['name']; $article = $_POST['article']; $image = IMAGEREPOSITORY.$_FILES['image']['name']; $query = "INSERT INTO articles SET ID=LAST_INSERT_ID(), header='$name', article='$article', summary='$article', image='$image', timestamp=CURRENT_TIMESTAMP"; $result = mysql_query($query); if ($result) { echo "Article posted successfully!"; } else { echo "<font color=red>Article posting error!</font>"; } echo '</span>'; mysql_close(); } ?> Link to comment https://forums.phpfreaks.com/topic/69568-_files-does-not-work-on-windows/#findComment-350309 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.