Having problems downloading pictures of the net
Author |
Message |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sat Apr 19, 2003 2:17 am Post subject: Having problems downloading pictures of the net |
|
|
code: | var url : string
url := "http://www.geocities.com/stmxpm/finaly.jpg"
var netStream : int
var f : int
var ch : char
netStream := Net.OpenURLConnection (url)
open : f, "c:/downloaded file.jpg", write
loop
exit when eof (netStream)
get : netStream, ch
write : f, ch
%put ch
end loop
Net.CloseConnection (netStream)
close (f) | ok that's the code and it's supposed to download a jpg file off this address "http://www.geocities.com/stmxpm/finaly.jpg". well .... it downloads somethink and it's a picture but when i open it it's a whole new picture. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sat Apr 19, 2003 2:21 am Post subject: (No subject) |
|
|
when i use the program download bmp files it seems to work fine but it has a problem with all jpgs.
code: | var url : string
url := "http://www.geocities.com/stmxpm/sc1.bmp"
var netStream : int
var ch : char
netStream := Net.OpenURLConnection (url)
if netStream <= 0 then
put "Unable to connect to ", url
return
end if
var f : int
open : f, "c:/downloaded file.bmp", write
loop
exit when eof (netStream)
get : netStream, ch
write : f, ch
%put ch
end loop
Net.CloseConnection (netStream)
close (f) |
anybody knows how to solve the problem?[/code] |
|
|
|
|
![](images/spacer.gif) |
jamez
|
Posted: Sat Apr 19, 2003 7:25 am Post subject: (No subject) |
|
|
I made it able to download JPGs but it really screws up the pic.
code: | var location : string := ""
put "http://" ..
get location
location := "HTTP://" + location
var ch : char
var netStream : int := Net.OpenURLConnection (location)
if netStream <= 0 then
put "Image does not exist."
return
end if
put "Saving..."
var file : int
open : file, "C:/DownloadedImage." + location (length (location) - 2 .. length (location)), write
loop
exit when eof (netStream)
get : netStream, ch
write : file, ch
end loop
Net.CloseConnection (netStream)
close (file)
locate (2, 1)
put "Image saved." |
|
|
|
|
|
![](images/spacer.gif) |
Blade
|
Posted: Sat Apr 19, 2003 9:36 am Post subject: (No subject) |
|
|
well... i dunno if any of you guys ever had this problem, but when i was making a game, i could NOT use jpg's... i always had errors no matter what i did with it...but was fine with bmp's... could be a flaw in turing... |
|
|
|
|
![](images/spacer.gif) |
Catalyst
![](http://catalyze.mine.nu/jack_of_spades+100.jpg)
|
Posted: Sat Apr 19, 2003 11:12 am Post subject: (No subject) |
|
|
jpgs are only in 4.0x they wont work if u use 3.11 |
|
|
|
|
![](images/spacer.gif) |
Blade
|
Posted: Sat Apr 19, 2003 12:04 pm Post subject: (No subject) |
|
|
i use 4.0.4c |
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sat Apr 19, 2003 12:45 pm Post subject: (No subject) |
|
|
that's exactly my problem too i can download bmps but when i download jpgs they get screwed up =/ |
|
|
|
|
![](images/spacer.gif) |
|
|