TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hrvoje
NA
47
0
image upload
Jun 16 2009 2:36 AM
I'm using this code to upload a file to server, but it doesn't work for image file.
What should be changed?
FileInfo
uploadFile =
new
FileInfo
(cbFile.Text);
FtpWebRequest
request = (
FtpWebRequest
)
WebRequest
.Create(
"ftp:address"
+
uploadFile.Name);
request.Proxy =
null
;
request.Method =
WebRequestMethods
.
Ftp
.UploadFile;
request.Credentials =
new
NetworkCredential
(
username
, password
);
Stream
ftpStream = request.GetRequestStream();
FileStream
fStream =
File
.OpenRead(cbFile.Text);
int
length = 1024;
byte
[] buffer =
new
byte
[length];
int
byteRead = 0;
do
{
byteRead = fStream.Read(buffer,0,length);
ftpStream.Write(buffer,0,byteRead);
}
while
(byteRead !=0);
fStream.Close();
ftpStream.Close();
Reply
Answers (
1
)
Nodes.Tag..
intellisense in a asp textbox