on 03-18-2009 12:06 PM
Dear Experts.
I need to transfer some exteral parameter (maximum file size, which users can attach)
from Netweaver Portal to webdynpro application.
Portal administrator should have ability to change those parameter without ear file rebuilding.
Could you please describe any possible ways for this task.
Now my problem is solved thank you for your attention.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sergey Tuzov,
It is possible to pass the parameter using the ivew Parameters. Those parmaters can be set at the portal side and can be accessed in th ewebdynpro application. You need not have to rebuild the ear by this way.
Check this code:
String hostName = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("parameterName");
Check this link for more details:
Regards
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sergey it's possible to transfer some external parameters from your iView to webdynpro application. Is it possible to elobarate further on your requirements?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Santosh, task description is the following:
How users have ability to attach file in webdynpro application. Files are storing in KM.
It is nesessary to restrict maximum file size which can be attached.
So, I need to read maximum file size parameter from external environment in webdynpro application.
Hi,
For that you can simple use the JAVA code to check the file size before uploading...
Please check this code which calculates the file size. If the file size is greater than what your requirement is just show the error to user and return from the function:
Check this class file:
import java.io.File;
public class FileUtil {
public long getFileSize(String filename) {
File file = new File(filename);
if (!file.exists() || !file.isFile()) {
System.out.println("File doesn\'t exist");
return -1;
}
//Here we get the actual size
return file.length();
}
public static void main(String[] args) {
FileUtil fileutil = new FileUtil();
long size = fileutil.getFileSize("/temp/myfile1.txt");
System.out.println("Filesize in bytes: " + size);
}
}
You can also have a look to this code:
File file = new File("c:/temp/logo.jpg");
long byteSize = file.length();
// Divide by 1024 to get size in KB
long kbSize = byteSize / 1024;
System.out.println(byteSize + " bytes");
System.out.println(kbSize + " KB");
I hope this will solve your issue.
Thanks and Regards
Pravesh
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.