Mit HTML-Form-Input-Type-File?

Ich habe ein HTML-Formular wie folgt:

<form action="/AddFile" method="post">
    <input type="file" name="filedata"/>
    <input type="submit" value="Add File"/>
</form>

Wenn ich es benutze, und legt eine Datei namens foo mit Inhalt bar die POST-Anforderung enthält filedata=foo nicht filedata=bar als erwartet.

Was mache ich falsch? Wie bekomme ich den Inhalt der Datei?

InformationsquelleAutor Andrew Tomazos | 2012-09-19

Schreibe einen Kommentar