watthehell Posted August 31, 2007 Share Posted August 31, 2007 can anyone help on this function please function UploadFile($filen,$filepath) { if(!move_uploaded_file($_FILES[$filen]["tmp_name"],$filepath)) { echo"Could not copy file"; exit; } What is $filen and $filepath here... i write like this $strfilepathgif=UploadFile("txtimagegif","animatedgif"); is this ok Quote Link to comment https://forums.phpfreaks.com/topic/67407-solved-can-anyone-help-on-this-function-please/ Share on other sites More sharing options...
redbullmarky Posted August 31, 2007 Share Posted August 31, 2007 a) nothing to do with OOP (moved) b) you have enough here for the manual to be of assistance. http://www.php.net/move_uploaded_file c) you havent said if anything is wrong or if you got any errors d) in answer to your question "Is this ok?" then the answer is simple: if it works, yes it's ok. if it doesnt work, no it's not. Please explain yourself much more clearly giving all the information/errors/issues you have. Quote Link to comment https://forums.phpfreaks.com/topic/67407-solved-can-anyone-help-on-this-function-please/#findComment-338494 Share on other sites More sharing options...
watthehell Posted August 31, 2007 Author Share Posted August 31, 2007 so sweet i really loved it.. thanks a) nothing to do with OOP (moved) for this i thought this function was inside a class so i thought it was OOP b) you have enough here for the manual to be of assistance. http://www.php.net/move_uploaded_file this didnt solved my problem c) you havent said if anything is wrong or if you got any errors my error is like this Warning: move_uploaded_file(../animatedgif) [function.move-uploaded-file]: failed to open stream: Permission denied in c:\wamp\www\myfile\admin\addtest.php on line 123 d) in answer to your question "Is this ok?" then the answer is simple: if it works, yes it's ok. if it doesnt work, no it's not. IT did not work so it is not ok.... my code is like this if($frfilenamegif!="" && $imageErrorFlag==false) { $strfilepath=move_uploaded_file($_FILES["txtimagegif"]["tmp_name"],"../animatedgif"); $strfile=$strfilepath; if($strfilepath==-1) { $lblmsg=" Image isn't in proper size."; $imageErrorFlag1=true; $strfile=""; } } it shows the error i posted above can anybody help please.... Quote Link to comment https://forums.phpfreaks.com/topic/67407-solved-can-anyone-help-on-this-function-please/#findComment-338501 Share on other sites More sharing options...
watthehell Posted September 1, 2007 Author Share Posted September 1, 2007 I DID it hence solVed.......... ;D ;D ;D ;D Quote Link to comment https://forums.phpfreaks.com/topic/67407-solved-can-anyone-help-on-this-function-please/#findComment-339333 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.