cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynPro FileUpload UI Control: File Size limitations...... ?

paras_arora3
Participant
0 Kudos

Folks,

I am into development of a webDynPro iView, which uses webDynPro FileUpload UI control to upload files on the server. I tried searching but couldnt get my hands on any sap documentation, specifying the size limiations for the file size which can be uploaded using the FileUpload UI control. Request all to share any information/links about the same.

What is the maximum file size, FileUpload UI control can upload into the webDynPro context ?

Most importantly, it would be great help if any of you can share a sap documentation link, which specifies size limitations of webDynPro context/FileUpload UI control.

-- Maximum points to the one who gives out relevant sap documentation links.

Cheers

Paras

Accepted Solutions (0)

Answers (3)

Answers (3)

nikhil_bose
Active Contributor
0 Kudos

plz go through Documentation

[Http Provider Service|http://help.sap.com/saphelp_nw04/helpdata/en/8c/541eed26ef934cb161ed0b65a050ee/content.htm]

[File Cache Size|http://help.sap.com/saphelp_nw04/helpdata/en/70/717cfb7d226e44ad4960877da612a4/content.htm]

thread:[upload limitations|;

nikhil

Former Member
0 Kudos

Hi,

i have used this UI, but at that time restriction on the file size was 2 MB from the client so we code for that.

i can share the code to achieve the same:-

fileData = wdContext.currentImageUploadElement().getImageData();

int length =wdContext.currentImageUploadElement().getImageData().length;

float size = fileData.length / 1024.0f;

String uploadFilename = wdContext.currentImageUploadElement().getImageName();

uploadFilename = uploadFilename.toLowerCase();

if (length == 0) {

wdContext.currentFileNamesElement().setImage(wdContext.nodeCreateView()

.currentCreateViewElement()

.getAD_CreateVw_setThumbnail_lbl());

}

else if (size > 50.00f) {

wdContext.currentFileNamesElement().setImage(wdContext.nodeCreateView()

.currentCreateViewElement()

.getAD_CreateVw_setImage_Error_lbl());

}

else if (uploadFilename.endsWith(".jpg")|| uploadFilename.endsWith(".jpeg")

|| uploadFilename.endsWith(".gif")

|| uploadFilename.endsWith(".tif")

|| uploadFilename.endsWith(".png")) {

try {

tempFilePath = kmEvents.uploadFileElementForAttachment(

wdContext.currentImageUploadElement().getImageName(),

fileData,language,1,userInfo,mgr);

if (tempFilePath != null&& (!"".equalsIgnoreCase(tempFilePath)))

uploaded = true;

else

uploaded = false;

} catch (Exception e) {

wdComponentAPI.getMessageManager().reportException(

wdContext

.nodeCreateView()

.currentCreateViewElement()

.getAD_CreateVw_Image_Folder_Error(),

false);

uploaded = false;

}

if (uploaded) {

String fileName =

wdContext

.currentImageUploadElement()

.getImageName();

fileName.substring(fileName.lastIndexOf("
") + 1);

wdContext.currentFileNamesElement().setImage(

fileName

+ " "

+ wdContext

.nodeCreateView()

.currentCreateViewElement()

.getAD_CreateVw_Success_Upload_msg());

events.setImagePath(tempFilePath);

wdContext.currentLabelsElement().setUpload_Image(

wdContext

.nodeCreateView()

.currentCreateViewElement()

.getAD_CreateVw_Remove_lbl());

imageuploadFlag = true;

wdContext.currentVisibilityElement().setImage(

false);

}

To Get the PATH:-

public String uploadFileElementForAttachment(

String fileName,

byte data[],

String language,

int flag,

UserInfo user,

IWDMessageManager mgr)

throws

NotSupportedException,

AccessDeniedException,

ResourceException,

FileNotFoundException,

IOException,

NullPointerException {

String fileRID = null;

kmPath = getAttachmentPath(flag, user);

fileName = fileName.substring(fileName.lastIndexOf("
") + 1);

pathRID = RID.getRID(kmPath);

collection =

(ICollection) resourseFactory.getResource(pathRID, resourseContext);

File destfile = new File(fileName);

FileOutputStream out = new FileOutputStream(destfile);

if (data != null) {

out.write(data);

}

BufferedInputStream bufInStream =

new BufferedInputStream(new FileInputStream(destfile));

Content con = new Content(bufInStream, "byte", -1);

String newFileName =

(new Timestamp(System.currentTimeMillis())).toString();

newFileName = newFileName.trim() + fileName;

String temp = this.getFileNameForAttachment(newFileName);

StringTokenizer token = new StringTokenizer(temp);

StringBuffer buff = new StringBuffer();

while (token.hasMoreTokens()) {

temp = token.nextToken(" ");

buff.append(temp);

}

temp = buff.toString();

IResource newFile = collection.createResource(temp, null, con);

fileRID = newFile.getAccessRID().toString();

con.close();

bufInStream.close();

destfile.delete();

return fileRID;

}

Hope this may help you.

Regards,

Deepak

jnmurthi
Participant
0 Kudos

hi,

the following link would be helpful for you.

please check it out

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71]

[http://help.sap.com/saphelp_nw70/helpdata/EN/43/f546ebd54a025de10000000a1553f7/frameset.htm]

uploading file using webservice:

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0d9336b-b4cf-2910-bdbf-b00d89bd2929]

Regards,

Murthy.