/    Sign up×
Community /Pin to ProfileBookmark

First a thank you to Bokeh for putting up the file upload script from which I learnt a couple of important points.

The one think I don’t understand is why the use of
the @ symbol.

as in @is_uploaded_file( …
and @move_uploaded_file

In my script I was just using:
move_uploaded_file( …

which has been working just fine.

Does it make much difference ?

Thanks

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@GarySJun 15.2006 — The "@" suppresses error reporting.
Copy linkTweet thisAlerts:
@DaveinLondonauthorJun 15.2006 — Thanks for reply.

however after stating no error why does the error element have a comment

in it - "receiving directory ..." ?

@move_uploaded_file($_FILES['upLoad1']['tmp_name'];, $uploadFilename)

or error('receiving directory insuffiecient permission', homes_picts_fm.php);

Thanks
Copy linkTweet thisAlerts:
@GarySJun 15.2006 — Think the @ character suppresses the [i]display[/i] of the error message, though the error is still [i]logged[/i].
Copy linkTweet thisAlerts:
@ScleppelJun 15.2006 — The @ character suppresses PHP's error message, not the "or error()".

http://uk.php.net/manual/sl/language.operators.errorcontrol.php

The error is probably the semicolon after $_FILES['upLoad1']['tmp_name'].

[code=php]@move_uploaded_file($_FILES['upLoad1']['tmp_name'], $uploadFilename)
or error('receiving directory insuffiecient permission', homes_picts_fm.php);[/code]
Copy linkTweet thisAlerts:
@bokehJun 15.2006 — The reason it is there is because the error handler outputs a header. If move_uploaded_file raised a warning the error handler would no longer work.
×

Success!

Help @DaveinLondon 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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