Current location: Hot Scripts Forums » Programming Languages » PHP » checking file size before uploading


checking file size before uploading

Reply
  #1 (permalink)  
Old 04-28-05, 12:44 AM
sjems sjems is offline
Newbie Coder
 
Join Date: Apr 2005
Location: USA
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
checking file size before uploading

I am using html form to upload pictures in the database. I need a help. I want to check the file size before posting on the database. If the file size is more than 100 kb, the message will be shown and no information will be posted on the database. And vice versa.
Reply With Quote
  #2 (permalink)  
Old 04-28-05, 01:34 AM
olaf's Avatar
olaf olaf is offline
Newbie Coder
 
Join Date: Sep 2004
Location: The Netherlands
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Hi, there is no way (with php) you have to update first, maybe some activeX or java should be possible
Reply With Quote
  #3 (permalink)  
Old 04-28-05, 01:53 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by sjems
I am using html form to upload pictures in the database. I need a help. I want to check the file size before posting on the database. If the file size is more than 100 kb, the message will be shown and no information will be posted on the database. And vice versa.
on http://www.php.net/manual/en/features.file-upload.php theres a example how some browsers check for a hiddden field with max size.
but then if you dont want any information in to the database then you just need to check file size with $_FILES['userfile']['size']
that url i posted really has some really good information

and olaf.... he said to check file size before posting it to the database not before uploading, so there is defenetly a way to do it with in php

Last edited by <?Wille?>; 04-28-05 at 01:55 AM.
Reply With Quote
  #4 (permalink)  
Old 04-28-05, 11:12 AM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
let's the standard tell the truth:
a bit technical, but it contains all information that a web developer may need.
__________________
just an ignorant noob with moronic solution...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
uploading set file? cgott42 Everything Java 2 08-02-04 05:27 AM
setting a file mask for a file uploading input tag davidklonski JavaScript 0 07-07-04 06:22 AM
file uploading jaishalg PHP 1 06-22-04 11:54 AM
display file size leestratton Script Requests 1 04-23-04 11:56 AM
Upload file type and size limiter! Arctic ASP 1 08-02-03 07:06 PM


All times are GMT -5. The time now is 06:40 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.