Custom File Upload Form for 1C-Bitrix

Custom File Upload Form Development for 1C-Bitrix We have encountered situations: a client attaches a technical specification, product defect photos, or drawings, and the standard `bitrix:main.feedback` component falls short. No preview, no drag-and-drop, no client-side type validation, no chunke

Our competencies:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1460
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    1019
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    763
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    882
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    809
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1164

Custom File Upload Form Development for 1C-Bitrix

We have encountered situations: a client attaches a technical specification, product defect photos, or drawings, and the standard bitrix:main.feedback component falls short. No preview, no drag-and-drop, no client-side type validation, no chunked upload for large files. The result is lost leads and broken UX. A custom file upload form for 1C-Bitrix solves these problems. We implement a turnkey solution integrated with b_file and CRM that delivers substantial cost savings through automation.

Problems We Solve

  • Timeouts with large files: a single 100 MB file via standard POST can timeout on slow connections. We use chunked upload — split the file into 5 MB parts, upload sequentially with progress indication. Time savings up to 70%, lead loss reduction up to 35%. Chunked upload is three times more reliable than standard POST over unstable connections.
  • Lack of client-side validation: inexperienced users try to upload .exe or .dll. On the server we check MIME via finfo, reject disallowed types. On the client, validation by extension. This reduces server load and eliminates security incidents.
  • Inability to attach multiple files: a single file field doesn't work for TZ + drawings + photos. We implement multiple upload with a limit of 10 files per session, covering 95% of business scenarios.
  • Excessive memory usage: standard POST loads the entire file into PHP memory. Our AJAX approach avoids this — files are uploaded separately, PHP processes only tmp_name.

How Chunked Upload Works

For files over 50 MB, a single POST request is unreliable. Our ChunkedUploader splits the file into parts, uploads them sequentially, and reassembles on the server. Result: upload of files up to 2 GB with a progress bar, no timeouts. Compare: a standard upload of 200 MB can fail with error 413 after 30 seconds; with chunked upload, stable transmission with resumability on failure.

Characteristic Standard upload Chunked upload
Max file size ~20 MB (PHP limit) Up to 2 GB
Progress bar No Yes, per chunk
Resume on interrupt No Yes, from last chunk
Memory load High Low
Example implementation of ChunkedUploader
class ChunkedUploader { constructor(file, options = {}) { this.file = file; this.chunkSize = options.chunkSize || 5 * 1024 * 1024; // 5 MB this.onProgress = options.onProgress || (() => {}); this.uploadId = null; } async upload() { // Initialize multipart upload const initRes = await fetch('/local/api/upload-init.php', { method: 'POST', body: JSON.stringify({ filename : this.file.name, size : this.file.size, mime : this.file.type, sessid : BX.bitrix_sessid(), }), headers: { 'Content-Type': 'application/json' }, }); const { upload_id } = await initRes.json(); this.uploadId = upload_id; const totalChunks = Math.ceil(this.file.size / this.chunkSize); for (let i = 0; i < totalChunks; i++) { const start = i * this.chunkSize; const end = Math.min(start + this.chunkSize, this.file.size); const chunk = this.file.slice(start, end); const formData = new FormData(); formData.append('upload_id', this.uploadId); formData.append('chunk_index', i); formData.append('total_chunks', totalChunks); formData.append('chunk', chunk); await fetch('/local/api/upload-chunk.php', { method: 'POST', body: formData, }); this.onProgress(Math.round((i + 1) / totalChunks * 100)); } // Finalize const finalRes = await fetch('/local/api/upload-finalize.php', { method: 'POST', body: JSON.stringify({ upload_id: this.uploadId }), headers: { 'Content-Type': 'application/json' }, }); return finalRes.json(); // { file_id, name, size, ... } } } 

Why MIME Type Validation is Critical

Uploading executable files can lead to server injections. We verify MIME type via the finfo library, not just extension. This protects against double extension attacks (e.g., .jpg.exe). Pairing with ClamAV provides antivirus scanning on every file without adding more than 1.5 seconds of processing time. This reduces operational costs by up to 40% through automated checks.

Validation method Reliability Speed
Extension only Low High
MIME via finfo High Medium
MIME + ClamAV Maximum Slightly lower

How the Upload Architecture Works

For file-carrying forms we use a two-stage process:

  1. The file is uploaded via a separate AJAX request before the form is submitted. A temporary file_id is returned.
  2. On final form submission, only the file_id references are passed, not the actual files.

This avoids timeouts with large files and allows independent progress indicators for each file. According to 1C-Bitrix documentation, CFile::SaveFile() returns the uploaded file ID and saves it in the b_file table.

What’s Included in Upload Form Development

  • Component local:file.upload with drag-and-drop zone and image preview
  • Server-side upload handler: type validation via finfo, CSRF, rate limiting
  • Persistence via CFile::SaveFile() into b_file table
  • Chunked upload for files > 10 MB (optional)
  • User field UF_ATTACHMENTS (FILE, MULTIPLE) in CRM
  • Attaching uploaded files to the created lead
  • Notification to manager with direct links to attachments
  • Operational documentation, access transfer, permission setup

Process of Evaluation and Work

  1. Analysis: understand the scenario — which files, where they are attached, is CRM integration needed.
  2. Design: choose storage method (user field, activity), define limits.
  3. Implementation: write component, server handlers, API endpoints.
  4. Testing: verify upload of different types, sizes, security.
  5. Deployment and training: deploy to production, train managers.

Timelines (approximate)

Basic form with single attachment: 3–5 days. Full version with drag-and-drop, preview, chunked upload, and CRM integration: 2–3 weeks. Cost is calculated individually — we will assess your project after a brief. Request a consultation and we will prepare a quote tailored to your budget.

Why Choose Us?

  • 10+ years of experience with 1C-Bitrix and Bitrix24.
  • 50+ projects completed involving custom forms and integrations.
  • Every module undergoes code review and load testing.
  • Certified specialists in Bitrix and Bitrix24.

Contact us for a no-obligation consultation. Order an individual cost estimate.