Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
FormPoster.addFile
Adds a file (upload file path specification) to the MIME message under construction, as in
INPUT TYPE=FILE
.This method has two variants:
- addFile (Variant 1) adds a file (upload file path specification) to the MIME message under construction and allows you to specify the MIME type.
- addFile (Variant 2) adds a file (upload file path specification) to the MIME message under construction.
FormPoster.addFile
Adds a file (upload file path specification) to the MIME message under construction, as in
INPUT TYPE=FILE
.Syntax
public boolean addFile(String sParamName, String sValue, String sFileName, String sMIMEType)Parameters
sParamName
- The parameter name.
sValue
- Value of the parameter (usually the file name).
sFileName
- Path of the file to add.
sMIMEType
- String containing the MIME type of the file.
Returns
A boolean value.
Example
FormPoster fp = new FormPoster(); FTValList vlCookies; fp.setURL("http://myserver/servlet/CatalogManager"); // Add a new row to MyTable ftStatusCode ftStatus = new ftStatusCode(); status = fp.login(true, ftStatus, "myusername", "mypassword"); vlCookies = fp.findAllCookies(); Status = fp.addFile("url", "test.html", "/export/home/temp/test.html", "text/html"); Status = fp.addTextValue("tblname", "MyTable"); Status = fp.addURL("myparameter", "http://server/main.html"); Status = fp.addTextValue("id", "1323"); Status = fp.addTextValue("ftcmd", "addrow"); fp.setCookies(vlCookies); Status = fp.post(); // Fetch the response without the http headers CleanResponse = fp.cleanRawResponse(true); fp.login(false, ftStatus, null, null);See Also
FormPoster.addFile
Adds a file (upload file path specification) to the MIME message under construction, as in
INPUT TYPE=FILE
.Syntax
public boolean addFile(String sParamName, String sValue, String sFileName)Parameters
sParamName
- The parameter name.
sValue
- Value of the parameter (usually the file name).
sFileName
- Path of the file to add.
Returns
A boolean value.
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.