Jump to content

Upload Issue


EPCtech

Recommended Posts

Hello,

My website, en-psyche.com, is soon going to have a game arcade specifically designed for game players, and makers. We are accepting games created with Game Maker mostly, but anyways, I have an upload built for it, but for some reason, it wont let me upload the game, as an *.exe.

 

Here is my code:

if ($_GET['act']=='upload')
 {
 if (isset($_GET['submit']))
 		{
		$target = "uploads/".basename($_FILES['uploaded']['name']) ;
		$ok=1;
		if (($uploaded_type=="*****") or ($uploaded_type=="*******") or ($uploaded_type=="text/php"))
			 {
			 echo "Your upload extension was not in the upload parameters.";
			 $ok=0;
			 }
		if ($ok==0)
			 {
			 echo "Your file was not uploaded.";
			 }
		else
			 {
			 if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
					{
					mysql_query("INSERT INTO ******* (i*,u***,fi**) VALUES ('','".$username."','".basename( $_FILES['uploaded']['name'])."')") or die("Sorry, a MySQL error occured while uploading your file.<br />".mysql_error());
					echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
					}
			 else
					{
					echo "Sorry, there was a problem uploading your file.";
					}
			 }
		}
 else
 		{
 		echo("Upload a file:<a href='javascript:alert(\"Allowed file types are *.jpg, *.png, *.gif, *.exe, *.zip; None others.\");'>*</a><br /><form enctype='multipart/form-data' action='usercp?act=upload&submit=true' method='post'>Please choose a file: <input name='uploaded' type='file' /><br /><input type='submit' value='Upload!' /><br /><br /><center>By uploading any files to the En-Psyche server, you agree to our terms of service.</center></form>");
		}
 }

 

When you upload an *.exe, it says there was a problem uploading.

 

Thanks for any help

Link to comment
https://forums.phpfreaks.com/topic/140757-upload-issue/
Share on other sites

Hmm, is your host blocking this file type?

 

Does it work on a local development installation? (ie. WAMP)

I doubt the host is the problem, although I will talk to them about it.

 

I don't have the time to try out WAMP, although from looking on it in Google, it seems like it may.

 

Actually, that is just a modified version of a script I found with Google. I was wondering if anyone had a good upload script that I could use, because I'm not so sure about this one. It doesn't have mass security, and I just slipped past some glitches when first putting it in. ;)

Link to comment
https://forums.phpfreaks.com/topic/140757-upload-issue/#findComment-736754
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.