/    Sign up×
Community /Pin to ProfileBookmark

Image uploading

hello guyz i was thinking to code an script for image uploading
and i want your help ?

i want to make it secure
i mean so that only images can be uploaded ?
so in case if any hacker hack it & try to upload malcious files he didnt get success ?

so will u please help me ??

PS i am a newbie ?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@jedaisoulOct 04.2014 — Perhaps [url=lmgtfy.com/?q=php+file+upload]this[/url] will help?
Copy linkTweet thisAlerts:
@yhiauthorOct 04.2014 — dude but i want to make it secure ?
Copy linkTweet thisAlerts:
@jedaisoulOct 04.2014 — But you have not got anything to make secure! Or at least, if you have, where is it? Start at the beginning:

- Create some code.

- Give us a link to it.

- Hopefully someone here will help you improve it.
Copy linkTweet thisAlerts:
@yhiauthorOct 04.2014 — i have this

<form enctype="multipart/form-data" action="upload.php" method="POST"><input name="uploadedfile" type="file"/><input type="submit" value="Upload File"/></form> <?php $target_path=basename($_FILES['uploadedfile']['name']);if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path)){echo basename($_FILES['uploadedfile']['name'])." has been uploaded";}else{echo "Error!";}?>


but i dont know how to add restriction on any other file

i mean this code allow me to upload anything

i can upload php, html .htaccess anything ? which is dangerous

how to allow anly image files ?
Copy linkTweet thisAlerts:
@onlineustaadOct 04.2014 — Hi, this can be helpful for you: Image Upload Tutorial
×

Success!

Help @yhi 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 5.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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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