XHTMLforum

XHTMLforum (http://xhtmlforum.de/index.php)
-   (X)HTML (http://xhtmlforum.de/forumdisplay.php?f=72)
-   -   File Upload im IE (http://xhtmlforum.de/showthread.php?t=33334)

to.ni 01.10.2004 20:38

File Upload im IE
 
Hallo Forum,

Habe ein Formular, mit dem man ein Bild auf den Server übertragen kann. Im FireFox funktioniert alles prächtig, aber beim Uplaod im IE kommt kein Bild auf dem Server an...

Code:

<form id="form" action="index.php" method="post" enctype="multipart/form-data">
 <fieldset>
  <label>Bild-Name</label><input type="text" name="name" class="text" value="" />

  <label>Beschreibung</label><input type="text" name="beschreibung" class="text" value="" />

  <label>Bild</label><input type="file" name="bild" class="text" />

  <label></label><input type="submit" class="button" value="Speichern" /><input type="hidden" name="act" value="galerienew" />
 </fieldset>
</form>

Habt ihr da eine Idee?

Danke für eure Hilfe!

mfg to.ni

toscho 01.10.2004 20:53

Hm, eigentlich sehe ich da nichts, was Probleme verursachen könnte.
Hol dir mal ieHTTPHeaders und guck dir an, was der IE da sendet. Sollte ungefähr so aussehen (Beispiel von meiner Seite):
Code:

POST /tools/data-url-generator/ HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Referer: http://scholz-webdesign.de/tools/data-url-generator/
Accept-Language: de
Content-Type: multipart/form-data; boundary=---------------------------7d437a2c0496
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon)
Host: scholz-webdesign.de
Content-Length: 390
Connection: Keep-Alive
Cache-Control: no-cache

Was ist bei dir anders?

Gruß
Thomas

Boris 01.10.2004 23:21

Interessant wäre auch das PHP-Skript, dass die Datein hochlädt und verarbeitet.

to.ni 02.10.2004 14:45

Hallo zusammen,

danke für den Tipp mit dem Tool.

hier mal der HTTP-Header von Client/Server:

Code:

POST /Admin/index.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://url.de/Admin/index.php?mod=galerie&show=new
Accept-Language: de
Content-Type: multipart/form-data; boundary=---------------------------7d42f42ab80206
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Host: www.url.de
Content-Length: 34784
Connection: Keep-Alive
Authorization: Basic bnV0czprdWx0aWc=

HTTP/1.1 200 OK
Date: Sat, 02 Oct 2004 11:36:12 GMT
Server: Apache/1.3.28
X-Powered-By: PHP/4.3.3
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

Sehe da eigentlich keinen Unterschied. Lediglich Authorization, aber das liegt vermutlich daran, dass der File-Upload in einem .htaccess-geschützen Verzeichnis liegt.

Zum PHP-Skript: Eigentlich ist da nichts besonderes drinnen und vom Mozilla aus funktioniert ja auch alles. Entsprechend vermute ich, dass das Problem schon Clientseitig ist...
Soll ich den PHP-Code trotzdem posten? Nicht dass es dann heißt "off-topic" oder so.

mfg to.ni

Boris 02.10.2004 15:54

Ja, zeig uns das Skript. Man weiss ja nie ...

toscho 02.10.2004 17:53

Jepp, poste mal das Skript. Ich habe so den Verdacht, daß du dich auf bestimmte Bildtypen verläßt — das geht mit dem IE nicht, der sendet gerne die falschen.
Im Data-URL-Generator habe ich deshalb extra sowas drin:
Code:

        $bild_typ = safe_names($_FILES['bild']['type']);

        /* für IE Win, der gerne den falschen
        * Typ überträgt... */
        $bild_typ = str_replace('x-png', 'png', $bild_typ);
        $bild_typ = str_replace('pjpeg', 'jpg', $bild_typ);

Gruß
Thomas

to.ni 03.10.2004 19:16

Nochmal hallo,

jetzt hat es sich erledigt. War wirklich die Mimetype-Abfrage. Sch...öner IE... Hatte ja schonmal gelesen, dass der IE den pjpeg verwendet, aber dran gedacht hab ich nicht...

Thanks for help!

mfg to.ni


Alle Zeitangaben in WEZ +2. Es ist jetzt 12:23 Uhr.

Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

© Dirk H. 2003 - 2023