/    Sign up×
Community /Pin to ProfileBookmark

Which First ? is_uploaded_file Or move_uploaded_file ?

Php Lovers,

Do we use the is_uploaded_file before the move_uploaded_file or is it the other way round ?
So far, i got it like this:

[code]
if(!is_uploaded_file($file_tmp)) die(“Error 5a: Your file failed to upload via HTTP POST! Try some other time.”);
if(!move_uploaded_file($file_tmp, “$directory_path/$user/$file_name”)) die(“Error 5b: Your file failed to upload! Try some other time.”);
else
{
move_uploaded_file($file_tmp, “$directory_path/$user/$file_name”); //WHY IS NOT THIS LINE OF CODE MOVING THE FILE TO DESTINATION ?
//Notify user their Id Verification Video File was uploaded successfully.
echo “Your Video File “$file_name” has been uploaded successfully!”;
exit();
}
[/code]

I see no difference if I get it the other way round. However, which is correct method ?
Got introduced to the is_uploaded_file here:
https://www.developershome.com/wap/wapUpload/wap_upload.asp?page=php4

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @site-developer spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...