Slim Image Cropper symfony2

时间:2017-03-31 21:06:21

标签: jquery symfony twitter-bootstrap-3

我使用了Slim Image Cropper和symfony 2,它具有响应性,非常适合移动设备和桌面设备,但是当我将它添加到我的symfony项目中时,我有点卡住了。

在上传中有一些文件很多是.js文件和一些php文件。

,我想以may形式上传一个头像,我在我的表单中使用它

<div class="slim" style="border-radius: 50%;"
     data-label="drag your image here"
     data-ratio="1:1"
     data-service="async.php"
     data-size="200,200">
    {{ form_widget (form.imageFile ,{'name':'slim[]', 'attr': {'type': 'file'}} ) }}
</div>
裁剪后

我有这样的输入:

<input type="file" id="imageFile" accept="image/jpeg,image/png,image/gif,image/bmp" style="margin-bottom: 100%;" aria-required="true"></input>

<input type="hidden" name="imageFile" value="{&quot;server&quot;:null,&quot;meta&quot;:null,&quot;input&quot;:{&quot;name&quot;:&quot;140929113850-saeed-ahmed-profile-image-full-169.jpg&quot;,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;size&quot;:254064,&quot;width&quot;:1600,&quot;height&quot;:900},&quot;output&quot;:{&quot;width&quot;:200,&quot;height&quot;:200,&quot;image&quot;:&quot;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB......">

....:很多我不理解的剧本

当我点击提交按钮时,我有这个错误: 类型&#34; Symfony \ Component \ HttpFoundation \ File \ File&#34;,&#34; string&#34;的预期参数;给定

error srcean hot

如何成功解析Json图像对象到我的输入文件,所以我可以上传!!

0 个答案:

没有答案