# Extjs- Formular kommt ohne Datei an

**URL:** https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352
**Category:** Shopware 3.5
**Tags:** programming
**Created:** [7. Dezember 2012 um 11:16 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352 "2012-12-07T11:16:35Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![ecomai](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ecomai](https://forum.shopware.com/u/ecomai)
#### Post date: [7. Dezember 2012 um 11:16 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/1 "2012-12-07T11:16:35Z")

</div>

Ich habe ein Extjs-Formular gebaut in dem auch ein “fileuploadfield” zum Dateiupload enthalten ist. Nur leider bleibt $\_FILES im Controller leer. Als POST-Variable kommt der Wert “proof”, die Variable des Uploadfeldes, leer an. Bei einem “normalen” Formular hätte ich ja auf ein fehlendes “multipart/form-data” getippt, aber hier komme ich jetzt nicht weiter. Was kann die Ursache sein? Auszug aus main.js ` onPackbandSave: function(btn) { var win = btn.up('window'), // Get Window form = win.down('form'), // Get the DOM Form used in that window formBasis = form.getForm(), // Extract the form from the DOM me = this, // copy the current scope to me, because the 'this' scope tends to change store = me.getStore('Packbaender'), // load the supplier store record = form.getRecord(); // Detail View manager if (!(record instanceof Ext.data.Model)){ record = Ext.create('Shopware.apps.Baehr.model.Packband'); } formBasis.updateRecord(record); if (formBasis.isValid()) { record.save({ callback: function() { // reload the store store.load(); // and close the window. win.close(); Shopware.Msg.createGrowlMessage('',me.messages.saveDialogSuccess, me.messages.growlMessage); } }); } }, ` Auszug aus der View edit.js ` { xtype: 'fileuploadfield', name: 'proof', id: 'proof', emptyText: '{s name=proof\_upload\_text}Bitte Korrekturabzug auswählen{/s}', fieldLabel: '{s name=proof\_upload}Korrekturabzug{/s}', buttonText: '{s name=proof\_search}Durchsuchen{/s}' } ` Auszug aus Model ` Ext.define('Shopware.apps.Baehr.model.Packband', { extend: 'Ext.data.Model', fields: [//{block name="backend/baehr/model/packband/fields"}{/block} 'id', 'payment\_status', 'status', 'image', 'history', 'ordernumber', 'proof', 'name', { name: 'date', type: 'date', dateFormat:'Y-m-d' },], idProperty : 'id', proxy: { type: 'ajax', api: { //read out all articles read: '{url controller="Baehr" action="getPackbaender"}', update : '{url controller="Baehr" action="updatePackband"}', save : '{url controller="Baehr" action="updatePackband"}', }, reader: { type: 'json', root: 'data', //total values, used for paging totalProperty: 'total' } } }); `

---

<div class="post-metadata">

### Author: ![ecomai](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ecomai](https://forum.shopware.com/u/ecomai)
#### Post date: [10. Dezember 2012 um 09:03 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/2 "2012-12-10T09:03:52Z")

</div>

Hat keiner eine Idee auf was man bei einem Fileupload achten muss? Braucht es weitere Infos? Die normalen Daten aus Textfeldern etc. kommen im Controller an, nur eben keine “Dateien” aus dem Dateiwauswahlfeld ☹

---

<div class="post-metadata">

### Author: ![troemmelt](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/troemmelt/32/71_2.png) [@troemmelt](https://forum.shopware.com/u/troemmelt)
#### Post date: [14. Januar 2013 um 15:21 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/3 "2013-01-14T15:21:56Z")

</div>

Hast du schon eine Lösung ? Ich habe nämlich ein ähnliches Problem!

---

<div class="post-metadata">

### Author: ![leseaw](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@leseaw](https://forum.shopware.com/u/leseaw)
#### Post date: [14. Januar 2013 um 15:27 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/4 "2013-01-14T15:27:23Z")

</div>

kann es sein das da der sqlinjectionschutz zuschlägt?

---

<div class="post-metadata">

### Author: ![ecomai](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ecomai](https://forum.shopware.com/u/ecomai)
#### Post date: [14. Januar 2013 um 15:33 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/5 "2013-01-14T15:33:47Z")

</div>

Ich kam da nicht weiter. Ich bin dann auf das Shopware-Medienauswahlelement ausgewichen. Ist nicht ideal… Ich meine dass ich im Quelltext dann irgendwann tatsächlich gefunden habe, dass der Multipart-Teil in der Form fehlte. Auch folgende Ergänzung brachte nichts: ` return Ext.create('Ext.form.Panel', { fileUpload : true, enctype : 'multipart/form-data', `

---

<div class="post-metadata">

### Author: ![troemmelt](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/troemmelt/32/71_2.png) [@troemmelt](https://forum.shopware.com/u/troemmelt)
#### Post date: [14. Januar 2013 um 15:45 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/6 "2013-01-14T15:45:12Z")

</div>

ich glaube auch, dass da irgendein schutz greift, weil er einfach die postdaten löscht… egal wie du versuchst drauf zuzugreifen… aber es muss ja eine lösung geben. Edit: Du schreibst, dass die andern Felder deines Formulars ankommen! Kannst du auf die auch zugreifen über $this-\>Request()-\>getParams() ?? ich habe nämlich das Problem, dass ich in meinem Controller nicht an die Post-Daten omme, obwohl die im Firebug als Post (Json-Array) ankommen!

---

<div class="post-metadata">

### Author: ![ecomai](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ecomai](https://forum.shopware.com/u/ecomai)
#### Post date: [14. Januar 2013 um 19:06 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/7 "2013-01-14T19:06:03Z")

</div>

Ja, bei mir kommen die sonstigen Post-Daten im Controller an. Sowohl über ` $this-\>Request()-\>get('status') ` als auch über ` $params = $this-\>Request()-\>getParams(); $params['status'] ` kann ich auf die zugreifen.

---

<div class="post-metadata">

### Author: ![mablae](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mablae](https://forum.shopware.com/u/mablae)
#### Post date: [15. Januar 2013 um 04:07 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/8 "2013-01-15T04:07:10Z")

</div>

Hi, Ich würde mich mit Xdebug mal durch einen Request-Cylce „hangeln“, um zu prüfen, wie dass $\_POST Array verarbeitet wird. Wenn irgendwann etwas gelöscht wird, bekommt man das so raus. „Trocken“ ist es relativ schwierig das Request durch die Dependeny Hölle (Shopware =\> Enlight =\> Zend) zu verfolgen. Ich nutze für Debugging die geniale PHP Storm IDE. Wenn ihr Fragen zur Einrichtung unter Linux habt, her damit. Besten Gruß Malte

---

<div class="post-metadata">

### Author: ![troemmelt](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/troemmelt/32/71_2.png) [@troemmelt](https://forum.shopware.com/u/troemmelt)
#### Post date: [15. Januar 2013 um 09:32 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/9 "2013-01-15T09:32:14Z")

</div>

ich hooke ja ein bestehendes plugin und binde da mein eigenes formular ein, vllt liegts auch daran??

---

<div class="post-metadata">

### Author: ![ecomai](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ecomai](https://forum.shopware.com/u/ecomai)
#### Post date: [15. Januar 2013 um 09:47 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/10 "2013-01-15T09:47:38Z")

</div>

Könnte sein. Bei mir ist zumindest alles “from scratch”, also eine komplett eigene SubApplication.

---

<div class="post-metadata">

### Author: ![troemmelt](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/troemmelt/32/71_2.png) [@troemmelt](https://forum.shopware.com/u/troemmelt)
#### Post date: [15. Januar 2013 um 10:10 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/11 "2013-01-15T10:10:21Z")

</div>

kannst du zeigen, wie du deine fenster im bootstrap eingebunden hast, oder hast du da auch nur die app.js included?? und wie schaut dein formular aus? machst du das über einen container oder ein panel? Danke dir Edit: Ich habs geschafft. Bei mir lags daran, dass im controller in der public function init(){} folgende zeile gefehlt hat: parent::init();

---

<div class="post-metadata">

### Author: ![ecomai](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ecomai](https://forum.shopware.com/u/ecomai)
#### Post date: [15. Januar 2013 um 10:29 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/12 "2013-01-15T10:29:52Z")

</div>

Freut mich!

---

<div class="post-metadata">

### Author: ![wwu](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wwu](https://forum.shopware.com/u/wwu)
#### Post date: [12. Juni 2013 um 17:29 UTC](https://forum.shopware.com/t/extjs-formular-kommt-ohne-datei-an/10352/13 "2013-06-12T17:29:11Z")

</div>

Hallo, ich würde gern ein vorhandenes Shopware Formular um eine Dateiuploadfunktion erweitern. Leider habe ich nirgendwo gefunden ob und wie das geht. Im Store gibt es auch nur ein Plugin für den Upload in Artikeln. Könnt ihr mir vielleicht weiterhelfen?
