فرم آپلود / ناحیه رها کردن
مثال و دستورالعمل های استفاده برای فیلدهای فرم آپلود با نوع ورودی فایل پیش فرض و با افزونه Dropzone.
فیلد آپلود پیش فرض
آپلود فایل با نوع فایل ورودی پیش فرض.
مثال کد
<div class="form-group"> <label class="form-label" for="customFileLabel">آپلود فایل پیش فرض</label> <div class="form-control-wrap"> <div class="form-file"> <input type="file" class="form-file-input" id="customFile"> <label class="form-file-label" for="customFile">انتخاب فایل</label> </div> </div> </div> <div class="form-group"> <label class="form-label" for="customMultipleFilesLabel">آپلود چندین فایل</label> <div class="form-control-wrap"> <div class="form-file"> <input type="file" multiple class="form-file-input" id="customMultipleFiles"> <label class="form-file-label" for="customMultipleFiles">انتخاب فایل ها</label> </div> </div> </div>
ناحیه رها کردن
سیستم آپلود فایل با افزونه Dropzone js، برای مستندات بیشتر، لطفا مستندات رسمی Dropzone را بررسی کنید
مثال کد
<div class="upload-zone"> <div class="dz-message" data-dz-message> <span class="dz-message-text">فایل را بکشید و رها کنید</span> <span class="dz-message-or">یا</span> <button class="btn btn-primary">انتخاب</button> </div> </div>
مرجع کد | جزئیات |
---|---|
[data-max-files="1"] |
از {number} با ویژگی data-max-files برای تعیین محدودیت فایل در dropzone استفاده کنید |
[data-max-file-size="4"] |
از {number} با ویژگی data-max-file-size برای تعیین محدودیت حجم فایل (مگابایت) در dropzone استفاده کنید |
[data-accepted-files="image/*"] |
از {filetype} با ویژگی data-accepted-files به عنوان image/*، .docx، .psd، .txt. و غیره استفاده کنید تا نوع فایل پذیرفته شده را تعیین کنید |