if (!isset($_GET['id'])) {
$klasör = "../uploads/post/image";
$inputname= $_FILES['resim'];
$tmp_name = $inputname['tmp_name'];
$name = $inputname['name'];
$size = $inputname['size'];
$tip = $inputname['type'];
$uzantı = substr($name,-4,4);
$sayı_uret1= rand(10000,50000);
$sayı_uret2= rand(10000,50000);
$resim_ad = $sayı_uret1.$sayı_uret2.$uzantı;
if (strlen($name)==0) {
echo "<script> Notiflix.Report.Failure( 'Error','Empty File Cannot Be Uploaded ','Ok',function(){ window.location.href = window.location.href;}); </script>";
exit();
}else if ($size> (1024*1024*3)) {
echo "<script>Notiflix.Report.Failure( 'Error','File Size Too Large Cannot Be Uploaded ',function(){ window.location.href = window.location.href;}); </script>";
exit();
} .......
,
验证文件大小:
<form action=
"process.php"
method=
"post"
enctype="multipart/form-data">
<label>
Your File:
<input type="file" name="yourfile" />
</label>
<input type="submit" value="send" />
</form>
假设您有一个 HTML 表单:
<?php
$size = $_FILES['yourfile']['size'];
$twoMB = 2*1024*1024; // two megabytes is 2*1024*1024 bytes
if ($size < $twoMB) {
// yay file is under 2 MB
} else {
echo 'oops you need to select a smaller file';
}
选择文件后,您将看到如下内容:
请注意,如果您选择 2GB 的文件,它仍然会到达那里。
验证
然后 process.php 看起来像这样:
int s = 1;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
for (int j = s - 1; j < dataGridView1.Rows.Count - 1; j++)
{
if (Convert.ToInt32(dataGridView1["Stok",j].Value) < 5)
{ s = j; dataGridView1.Rows.RemoveAt(j); break; }
}
}
dataGridView1.Refresh();
本文链接:https://www.f2er.com/4708.html