Jump to content
xisto Community
Sign in to follow this  
AlternativeNick

Php Upload

Recommended Posts

before i begin, i dont really know where to post this, so please move if neccessary

OK, im trying to make a php script that will upload something to whatever webserver it is im hosted on (currently ripway, Xisto soon) i was just wondering if Xisto will work with it?

im not very good with php yet, so im not sure what could be going wrong :S

anyways, what i have so far is this

<?phpif ( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],	   "../uploads/{$_FILES['uploadFile'] ['name']}")  )	  {  print '<p> The file has been successfully uploaded </p>';	   }else	  {		switch ($_FILES['uploadFile'] ['error'])		 {  case 1:				   print '<p> The file is bigger than this PHP installation allows</p>';				   break;			case 2:				   print '<p> The file is bigger than this form allows</p>';				   break;			case 3:				   print '<p> Only part of the file was uploaded</p>';				   break;			case 4:				   print '<p> No file was uploaded</p>';				   break;		 }	   }?>

it doesnt throw any errors, but it also doesnt upload anything that i can tell.

help plz?

Share this post


Link to post
Share on other sites

Now you have specified the ../uploads directory for upload, does that directory exists ? Also check in php.ini that you have granted the upload and in which dir (on linux sys , does php group has access to that dir) if ( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'], "../uploads/{$_FILES['uploadFile'] ['name']}") ) { print '<p> The file has been successfully uploaded </p>'; }

Share this post


Link to post
Share on other sites

yes the directory exists and it still doesnt upload it, however it is just a free host that im being hosted by, so i am unable to access php.ini or any of that.

also, does Xisto allow php uploads like that to my hosting? i.e. if i put an upload on my Xisto site, will i be able to have users of my site upload into my space on the server?

finally, what did you post this for? im not quite clear on that

if ( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],"../uploads/{$_FILES['uploadFile'] ['name']}") )
{ print '<p> The file has been successfully uploaded </p>';
}


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.