Originally posted by La La Lol
Announcement
Collapse
No announcement yet.
How do you validate files?
Collapse
X
-
-
Setting permissions on a file/folder to 777 should just allow any scripts on your server to edit or view it. That doesn't mean that someone can remotely upload files.
Leave a comment:
-
I have got another question here... I just want to allow people to upload images on my site, now it works fine but I MUST set the pemission to 777... is that very dangerous? I mean, peole can easily write another PHP on their website to massively upload files and viruses to that folder right? Is there anyway that I can make it so only my script can upload files to that folder? Thank you!
Leave a comment:
-
Originally posted by seanfThey should be the other way round
== equals
=== identical
!= not equal
!== not identical
<> not equal
< less than
> greater than
<= less than or equal to
>= greater than or equal to
SeanI test everything (Other then vB hacks because they normally give DB errors locally, or the the live server if I am doing both..) locally, so I can see if it gives a error due to my un-logic
Leave a comment:
-
Originally posted by SiGmA_XMake sure to check the direction of those Less Then, cuz I get them backwards most times..
== equals
=== identical
!= not equal
!== not identical
<> not equal
< less than
> greater than
<= less than or equal to
>= greater than or equal to
Sean
Leave a comment:
-
Well, check the file resource (that was stored in temp data) by using something like this:
PHP Code:$imgtest = getimagesize($img);
if (($imgtest[2] == 1) || ($imgtest[2] == 2))
echo "Image is a JPEG or GIF";
if (($imgtest[0] < 500) || ($imgtest[1] < 500))
echo "Image is smaller then 500x500px";
Last edited by SiGmA_X; Thu 8 May '03, 11:12am.
Leave a comment:
-
So what would the code look like say I only want gif and jpeg file with max. size 500 x 500? And I don't want people to upload files other than gif and jpeg... for example if people are trying to upload a html doc. how do I reject them but let them have jpeg or gif?
Thanks alot!
Leave a comment:
-
Originally posted by La La LolSay that I have an upload form on one of my web pages, how do I validates that all the files uploaded are images files only?(gif & jpg) And how do I specifly a maxium size in kbyte?
Thanks!
Leave a comment:
-
How do you validate files?
Say that I have an upload form on one of my web pages, how do I validates that all the files uploaded are images files only?(gif & jpg) And how do I specifly a maxium size in kbyte?
Thanks!Tags: None
Related Topics
Collapse
-
by [BLD]Hello,
I noticed that the attached files disappeared for some reason in any topics but when I click on "edit" then "save" without modifying the topic, the attached file...-
Channel: vB Cloud Support & Troubleshooting.
Tue 11 Apr '17, 2:01am -
-
by MyIceHello,
On our site, I was able to upload a single image, however I have yet to be able to upload any additional images. I have tried multiple browsers, and I receive the same error message:...-
Channel: Support Issues & Questions
Mon 25 Feb '13, 5:08pm -
-
by pzspinzHi I am using vBulletin Cloud -- the latest version 5.3.0
Resize Images set to: Yes
On the desktop, when I upload a larger image, I get this error:
"The Dimension...-
Channel: vB Cloud Support & Troubleshooting.
Fri 5 May '17, 11:11am -
Leave a comment: