🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: przesyłanie pliku

#51486
From: zpksoft
Date: Sun, 16 Nov 2014 18:34
20 lines
2065 bytes
W dniu sobota, 15 listopada 2014 21:47:23 UTC+1 użytkownik platformowe głupki napisał:
> czy istnieje gdzieś w necie (przynajmniej jak się nazywa) skrypcik JS 
> przesyłający obrazek na serwer zaraz po wybraniu poprzez forumalrz? Ktoś 
> podpowie?

Jeżeli poprzez formularz to nie jest potrzebny żaden skrypt. Skądś to mam zapisane:

<form method="post" enctype="multipart/form-data" onSubmit="return validate()" action="upload.php">
  <input type="file" name="nazwa1">
  <input type="submit" value="Wyślij">
</form>

function validate()
{
  if the size of the userfile is greater than 200 kb this function should be return false else it should return true
}

Ja nie używam formularzy. Stosuję AJAX & XMLHttpRequest

Paweł
Technical Details
Message-ID: <4eb11326-88b4-405c-b3f5-bc0f74429333@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.glorb.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!w8no276863qac.0!news-out.google.com!m4ni198qag.1!nntp.google.com!w8no276860qac.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <m48e4q$6jn$1@node2.news.atman.pl>

Show Full Headers
Complete Article Headers
X-Received: by 10.236.223.198 with SMTP id v66mr61256956yhp.21.1416162882629;        Sun, 16 Nov 2014 10:34:42 -0800 (PST)
X-Received: by 10.140.37.83 with SMTP id q77mr2117qgq.7.1416162882588; Sun, 16 Nov 2014 10:34:42 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.glorb.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!w8no276863qac.0!news-out.google.com!m4ni198qag.1!nntp.google.com!w8no276860qac.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.javascript
Date: Sun, 16 Nov 2014 10:34:42 -0800 (PST)
In-Reply-To: <m48e4q$6jn$1@node2.news.atman.pl>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.10.194.111; posting-account=8ND_mgoAAAD5J9y9fnaTB1Kcu7xKWk7Q
NNTP-Posting-Host: 83.10.194.111
References: <m48e4q$6jn$1@node2.news.atman.pl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4eb11326-88b4-405c-b3f5-bc0f74429333@googlegroups.com>
Subject: Re: przesyłanie pliku
From: zpksoft <zpksoft@op.pl>
Injection-Date: Sun, 16 Nov 2014 18:34:42 +0000
X-Received-Bytes: 1929
X-Received-Body-CRC: 1686507882
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit