C# 클래스 norvanco.http.MultipartForm

Allow the transfer of data files using the W3C's specification for HTTP multipart form data. Microsoft's version has a bug where it does not format the ending boundary correctly. Written by: [email protected]
파일 보기 프로젝트 열기: NGFieldScope/JS-FieldScope

보호된 프로퍼티들

프로퍼티 타입 설명
coRequest System.Net.HttpWebRequest

공개 메소드들

메소드 설명
MultipartForm ( string url ) : System

Initialize our class for use to send data files.

getFileheader ( string aFilename ) : string

Returns the proper content information for the file we are sending.

Hits Patel reported a bug when used with ActiveFile. Added semicolon after sendfile to resolve that issue. Tested for compatibility with IIS 5.0 and Java.

getFiletrailer ( ) : string

Creates the proper ending boundary for the multipart upload.

getFormfields ( ) : string

Builds the proper format of the multipart data that contains the form fields and their respective values.

getResponse ( ) : void

Here we actually make the request to the web server and retrieve it's response into a text buffer.

getStream ( ) : Stream

Determines if we have a file stream set, and returns either the HttpWebRequest stream of the file.

sendFile ( string aFilename, CookieContainer cookies ) : void

Transmits a file to the web server stated in the URL property. You may call this several times and it will use the values previously set for fields and URL.

sendFile ( string aFilename, Stream readIn, CookieContainer cookies ) : void
sendFile ( string aFilename, byte data, CookieContainer cookies ) : void
setField ( string key, string str ) : void

Allows you to add some additional field data to be sent along with the transfer. This is usually used for things like userid and password to validate the transfer.

setFilename ( string path ) : void

Used to signal we want the output to go to a text file verses being transfered to a URL.

writeString ( System io, string str ) : void

Mainly used to turn the string into a byte buffer and then write it to our IO stream.

메소드 상세

MultipartForm() 공개 메소드

Initialize our class for use to send data files.
public MultipartForm ( string url ) : System
url string The web address of the recipient of the data transfer.
리턴 System

getFileheader() 공개 메소드

Returns the proper content information for the file we are sending.
Hits Patel reported a bug when used with ActiveFile. Added semicolon after sendfile to resolve that issue. Tested for compatibility with IIS 5.0 and Java.
public getFileheader ( string aFilename ) : string
aFilename string
리턴 string

getFiletrailer() 공개 메소드

Creates the proper ending boundary for the multipart upload.
public getFiletrailer ( ) : string
리턴 string

getFormfields() 공개 메소드

Builds the proper format of the multipart data that contains the form fields and their respective values.
public getFormfields ( ) : string
리턴 string

getResponse() 공개 메소드

Here we actually make the request to the web server and retrieve it's response into a text buffer.
public getResponse ( ) : void
리턴 void

getStream() 공개 메소드

Determines if we have a file stream set, and returns either the HttpWebRequest stream of the file.
public getStream ( ) : Stream
리턴 System.IO.Stream

sendFile() 공개 메소드

Transmits a file to the web server stated in the URL property. You may call this several times and it will use the values previously set for fields and URL.
public sendFile ( string aFilename, CookieContainer cookies ) : void
aFilename string The full path of file being transfered.
cookies System.Net.CookieContainer
리턴 void

sendFile() 공개 메소드

public sendFile ( string aFilename, Stream readIn, CookieContainer cookies ) : void
aFilename string
readIn Stream
cookies System.Net.CookieContainer
리턴 void

sendFile() 공개 메소드

public sendFile ( string aFilename, byte data, CookieContainer cookies ) : void
aFilename string
data byte
cookies System.Net.CookieContainer
리턴 void

setField() 공개 메소드

Allows you to add some additional field data to be sent along with the transfer. This is usually used for things like userid and password to validate the transfer.
public setField ( string key, string str ) : void
key string The form field name
str string The form field value
리턴 void

setFilename() 공개 메소드

Used to signal we want the output to go to a text file verses being transfered to a URL.
public setFilename ( string path ) : void
path string
리턴 void

writeString() 공개 메소드

Mainly used to turn the string into a byte buffer and then write it to our IO stream.
public writeString ( System io, string str ) : void
io System The io stream for output.
str string The data to write.
리턴 void

프로퍼티 상세

coRequest 보호되어 있는 프로퍼티

Used mainly to avoid passing parameters to other routines. Could have been local to sendFile().
protected HttpWebRequest,System.Net coRequest
리턴 System.Net.HttpWebRequest