|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.shr.page.AgpTag | +--com.sssw.shr.page.AgpControlBase | +--com.sssw.shr.page.AgpFileUpload
Control for uploading a file to the server from an HTML page. Note that this is non-standard HTML.
This control appears as a text field with an associated Browse button. The file name length can be restricted. The kinds of files listed may also be restricted according to MIME content types.
Fields inherited from class com.sssw.shr.page.AgpTag |
UNIT_PERCENT,
UNIT_PIXEL |
Constructor Summary | |
AgpFileUpload()
|
Method Summary | |
void |
addAgiFileUploadListener(AgiFileUploadListener listener)
Add a listener for file upload events from this control. |
String |
getAccept()
Returns the MIME types acceptable for upload. |
byte[] |
getContent()
Returns the file contents of the uploaded file as a byte array or null if no file has been uploaded. |
String |
getContentType()
Returns the MIME type of the uploaded file as specified by the uploading browser. |
int |
getMaxLength()
Returns the maximum length of the pathname that can be entered. |
String |
getOriginalPath()
Returns the original pathname of the uploaded file as specified by the browser or null if no file has been uploaded. |
boolean |
hasFileBeenUploaded()
Returns whether a file has been uploaded in this request. |
void |
removeAgiFileUploadListener(AgiFileUploadListener listener)
Stop listening for file upload events. |
void |
setAccept(String mimedesc)
Specifies the MIME types acceptable for upload. |
void |
setMaxLength(int maxlength)
Sets the the maximum length of the pathname that can be entered. |
Methods inherited from class com.sssw.shr.page.AgpControlBase |
getName |
Methods inherited from class com.sssw.shr.page.AgpTag |
getBoolProperty,
getEnableHTMLGeneration,
getIntArrayProperty,
getIntProperty,
getIntPropertyUnit,
getProperty,
getStringArrayProperty,
invalidateHTML,
removeProperty,
setEnableHTMLGeneration,
setIntProperty,
setProperty |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Methods implemented from interface com.sssw.shr.page.AgiJavaScriptEnhanced |
generateFunction,
generateRepaintScript,
generateScriptInitializers,
getFunctionNameForMethod,
getFunctionNames,
getMethodNames,
getScriptObjectName,
isHTMLRepaintPending,
isJavaScriptRepaintPending |
Methods implemented from interface com.sssw.shr.page.AgiPageControl |
generateHTML,
getPrefix,
notifyPageLoaded,
notifyPageRequestBegin,
notifyPageRequestEnd,
notifyPostValue,
notifyPostValues |
Methods implemented from interface java.io.Externalizable |
readExternal,
writeExternal |
Constructor Detail |
public AgpFileUpload()
Method Detail |
public int getMaxLength()
int maxLength = file1.getMaxLength();
AgpFileUpload.setMaxLength(int maxlength)
public void setMaxLength(int maxlength)
maxlength
- an int representing the maximum length.file1.setMaxLength(260);
AgpFileUpload.getMaxLength()
public String getAccept()
The user's browser may limit the user's choice of files to upload based on this value.
String listOfMIMETypes = file1.getAccept();
AgpFileUpload.setAccept(String mimedesc)
public void setAccept(String mimedesc)
mimedesc
- a comma separated list of MIME types.The user's browser may limit the user's choice of files to upload based on this value.
file1.setAccept("text/plain,text/html,image/gif");
AgpFileUpload.getAccept()
public String getOriginalPath()
null
if no file has been uploaded.String originalPath = file1.getOriginalPath();
AgpFileUpload.getContent()
,
AgpFileUpload.getContentType()
public String getContentType()
null
if no file has been uploaded.String contentType = file1.getContentType();
AgpFileUpload.getContent()
,
AgpFileUpload.getOriginalPath()
public byte[] getContent()
null
if no file has been uploaded.byte content[]; content = file1.getContent();
AgpFileUpload.getContentType()
,
AgpFileUpload.getOriginalPath()
public boolean hasFileBeenUploaded()
This result may not be valid until a Submit event is received or the pageGenerateHTML event fires.
if (file1.hasFileBeenUploaded()) { // Do something with the file contents.... }
public void addAgiFileUploadListener(AgiFileUploadListener listener)
listener
- an instance of AgiFileUploadListener.file1.addAgiFileUploadListener(myListener);
AgpFileUpload.removeAgiFileUploadListener(AgiFileUploadListener listener)
public void removeAgiFileUploadListener(AgiFileUploadListener listener)
listener
- an instance of AgiFileUploadListener.file1.removeAgiFileUploadListener(myListener);
AgpFileUpload.addAgiFileUploadListener(AgiFileUploadListener listener)
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |