Jump to content

Uploading Files


Mencarta

Recommended Posts

I get the error: Warning: move_uploaded_file(http://localhost/projects/pptxfever.pptx) [function.move-uploaded-file]: failed to open stream: HTTP wrapper does not support writeable connections in C:\apache\server\projects\upload.php on line 8Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\TEMP\php1B8.tmp' to 'http://localhost/projects/pptxfever.pptx' in C:\apache\server\projects\upload.php on line 8When I try to run upload files with this script:upload.php

<?php	if (isset($_POST["type"])) {		if ($_FILES["file"]["error"] == UPLOAD_ERR_OK) {			$tmp = $_FILES["file"]["tmp_name"];			$name = $_FILES["file"]["name"];			$dir = "http://localhost/projects/".$_POST["type"].$name;			move_uploaded_file($tmp,$dir);		}	}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>	<head>		<title>Fever 1793 - Upload</title>		<link rel="stylesheet" type="text/css" href="fever.css" />		<script type="text/javascript" src="jquery.js"></script>		<script type="text/javascript">			$(function() {				$("div.file").slideUp("fast");				$("div.link").slideUp("fast");				$("input.file").click(function() {					$("div.link").slideUp("slow");					$("div.file").slideDown("slow");				});				$("input.link").click(function() {					$("div.file").slideUp("slow");					$("div.link").slideDown("slow");				});			})		</script>	</head>	<body>		<div id="header">			<h1>Fever 1793</h1>		</div>		<div id="page">			<form enctype="multipart/form-data" action="upload.php" method="post">			Upload: <input class="link" type="radio" name="type" value="link"> <b>Link</b> | <input class="file" type="radio" name="type" value="pptx"> <b>Powerpoint</b> | <input class="file" type="radio" name="type" value="scrapbooks"> <b>Scrapbook</b> | <input class="link" type="radio" name="type" value="gallery"> <b>Gallery</b>			<br />			<br />			<div class="file">				File: <input type="file" name="file">				<br />				<input type="submit" value="Upload" />			</div>			<div class="link">				Link: <input name="link" type="text" maxlength="200" />				<br />				<input type="submit" value="Upload" />			</div>			</form>		</div>	</body></html>

Does anybody know why?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...