मुझे टोकन और फ़ाइल फ़ील्ड फॉर्म में समस्या है।बड़ी फ़ाइलों के साथ Symfony2 अमान्य टोकन
प्रपत्र की मान्यता इस तरह है:
public function getDefaultOptions(array $options)
{
$collectionConstraint = new Collection(array(
'fields' => array(
'file' => new File(
array(
'maxSize' => '2M',
'mimeTypes' => array(
'application/pdf', 'application/x-pdf',
'image/png', 'image/jpg', 'image/jpeg', 'image/gif',
),
)
),
)
));
return array(
'validation_constraint' => $collectionConstraint
}
जब मैं एक आकार की सूचना अवैध फ़ाइल (~ 5MB) मैं इस त्रुटि मिलती है जो है मैं क्या आशा अपलोड करें:
The file is too large. Allowed maximum size is 2M bytes
लेकिन जब मैं एक बहुत बड़ी फ़ाइल (~ 30 एमबी) त्रुटि परिवर्तन अपलोड करता हूं:
The CSRF token is invalid. Please try to resubmit the form
The uploaded file was too large. Please try to upload a smaller file
समस्या त्रुटि टोकन है। मेरे पास {{form_rest (form)}} कोड है। मुझे लगता है कि त्रुटि परिवर्तन इस वजह से है: How to increase the upload limit for files on a Symfony 2 form?
मैं अपलोड सीमा में वृद्धि नहीं करना चाहता हूं। मैं चाहता हूं कि टोकन त्रुटि दिखाई न दे।
आप इस के साथ कहीं भी मिली थी? – richsage
मुझे इसके लिए कोई समाधान नहीं मिला। मैं getDefaultOptions में csrf_portection को गलत पर सेट करता हूं लेकिन यह त्रुटि संदेश से बचने के लिए है। यदि आपको कोई समाधान मिलता है, तो कृपया मुझे पिंग करें। – Biruwon