🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #39736

Re: Podglad wgrywanego obrazka

#39736
From: porneL
Date: Sun, 30 Apr 2006 12:54
28 lines
1743 bytes
On Sun, 30 Apr 2006 12:40:19 +0100, <talthen.z-serwera.o2@nospam.pl> wrote:

> Witam,
> <tr><td>Zdj?cie<td><input type="file" name="zdjecie"
> onchange="document.getElementById('img').src='file:///'+this.value"></tr>
> <tr><td colspan="2"><img id="img" width="320" height="180"></tr>
>
> W MSIE dziala elegancko. Operka zamiast do src obrazka wrzucic pelna  
> sciezke
> wrzuca tylko nazwe pliku, zas Firefox wrzuca co trzeba, ale obrazka nie
> widac.
>
> Jak to usprawnic?

Nie da się (z wyjątkiem dłubania w zaawansowanej konfiguracji FF).

Opera i Firefox umyślnie blokują dostęp do file: ze stron http:, aby  
uniemożliwić szpiegowanie (np. żeby nie dało sie sprawdzić czy dany plik  
istnieje).

Możesz przy onerror ukrywać <img> albo dać mu alt="", żeby w O/FF nie było  
widać problemu (bo podglądu i tak nie będzie).

-- 
* html {redirect-to: url(http://kurs.browsehappy.pl);}
this.author = new Geek("porneL");

http://pornel.net/krzaki-w-po?cie
Technical Details
Message-ID: <op.s8tmhqcyfux2e6@pornel.net>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <e327qm$37m$1@nemesis.news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: porneL <niusy@pornel.net>
Newsgroups: pl.comp.lang.javascript
Subject: Re: Podglad wgrywanego obrazka
Date: Sun, 30 Apr 2006 13:54:44 +0100
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 28
Message-ID: <op.s8tmhqcyfux2e6@pornel.net>
References: <e327qm$37m$1@nemesis.news.tpi.pl>
NNTP-Posting-Host: pornel.plus.com
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1146401724 27258 84.92.248.233 (30 Apr 2006 12:55:24 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Sun, 30 Apr 2006 12:55:24 +0000 (UTC)
X-User: pornelspam
User-Agent: Opera Mail(BETA2)/9.00 (MacPPC)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit