J
|
Jane 7/17/2007 |
Hi, $file_move = array($file['tmp_name'],GetUploadFolder($field).$value);
if($file["size"]>2048*1024) return false; $ext = substr($file["name"], strlen($file["name"])-4); $ext=strtoupper($ext); if($ext!=".JPG" && $ext!="JPEG" && $ext!=".BMP") return false; |
D
|
dcrera author 7/18/2007 |
Hi. Hi, you can put this checking into generated include\commonfunctions.php file. Find this line there: and put your checking just after. Here is the sample code: |
M
|
mmponline 7/18/2007 |
Is there a way to limit Mb size instead of pixels with similar code. |
J
|
Jane 7/18/2007 |
Stephan, *if($file["size"]>20481024) return false; ** $ext = substr($file["name"], strlen($file["name"])-4); $ext=strtoupper($ext); if($ext!=".JPG" && $ext!="JPEG" && $ext!=".BMP") return false;
if ($_FILES['file_FieldName']['size']>2048*1024) echo "file > 2mb"; |
D
|
dcrera author 7/18/2007 |
Hi Jane, Stephan, to limit size of the uploaded file use following code: To show message on the page use Before record added or Before record updated event on the Events tab. Here is a sample code: |
D
|
dcrera author 7/18/2007 |
Also, how do I get around to save large files of 4000 kb +/- Hi Jane, I tried this code and it does not seem to work $file_move = array($file['tmp_name'],GetUploadFolder($field).$value); $files_move[] = $file_move; return $value; if($file["size"]>20481024) return false; $ext = substr($file["name"], strlen($file["name"])-4); $ext=strtoupper($ext); if($ext!=".TIF") return false; In the Before Record is added if ($ext != ".TIF") {$error = 1; echo "Invalid file type, must be .tif";} error message is Undefined variable: ext Thanks |
J
|
Jane 7/19/2007 |
Hi, |
R
|
Rigmantas 3/6/2008 |
Hi, |