Fileupload errormessage

Hi,
we are getting the "Page cannot be displayed" error when attaching to PO.
the url where it is failing is "http://host.domain.port/pls/<SID>fnd_file_upload.uploadcompletemessage.
How can i fix this. and trace it why it is failing. (Recently i applied NLS patches).
I do not see any error message on the page. So where/how can i see the actual error
I saw some metalink docs, which says to run autoconfig. Can i run autoconfig when the appl. services are up for this purpose. It is on windows server 2003. 11.5.10.2
Regards
Taher
Edited by: user11970143 on Apr 24, 2010 8:50 AM
Edited by: user11970143 on Apr 24, 2010 8:52 AM

Hi hussein,
The complete error message is
TXK_TOP : e:\oracle\prodcomn\rgf\PROD_prodsrv
APPLTMP : e:\oracle\prodcomn\temp
LOCAL : PROD
ORACLE_LOCALPREFERENCE : e:\oracle\prodora\8.0.6\tools\admin
TNS CONNECT STRING : PROD
SQLPLUS : e:\oracle\prodora\8.0.6\bin\sqlplus.exe
Setting of Environment completed.
SQL Command: SELECT language_code||',' FROM fnd_languages WHERE installed_flag I
N ('B','I') AND language_code NOT IN ('US', 'SQ','IS','LT','VN')
ERROR DESCRIPTION:
(*******FATAL ERROR*******
PROGRAM : (e:\oracle\prodcomn\admin\install\PROD_prodsrv\txkFrmUTF8.pl)
TIME : Sat Apr 24 21:48:54 2010
FUNCTION: TXK::IO::open [ Level 3 ]
MESSAGES:
error = Unable to open file
errorno = No such file or directory
file = <e:\oracle\prodcomn\temp\sqlplus.txt
STACK TRACE
TXK::Error::abort('TXK::Error', 'HASH(0x9a2438)') called at e:\oracle\pr
odappl\au\11.5.0\perl/TXK/Common.pm line 299
TXK::Common::doError('TXK::IO=HASH(0xeceb70)', 'HASH(0xe81ba0)', undef)
called at e:\oracle\prodappl\au\11.5.0\perl/TXK/Common.pm line 314
TXK::Common::setError('TXK::IO=HASH(0xeceb70)', 'HASH(0xe81ba0)') called
at e:\oracle\prodappl\au\11.5.0\perl/TXK/IO.pm line 291
TXK::IO::open('TXK::IO=HASH(0xeceb70)', 'HASH(0x1291b60)') called at e:\
oracle\prodappl\au\11.5.0\perl/TXK/TechstackDB.pm line 616
TXK::TechstackDB::_getSQLValue('TXK::TechstackDB=HASH(0x8f3c44)', 'SELEC
T language_code||\',\' FROM fnd_languages WHERE installed_f...') called at e:\or
acle\prodappl\au\11.5.0\perl/TXK/TechstackDB.pm line 565
TXK::TechstackDB::getSQLValue('TXK::TechstackDB=HASH(0x8f3c44)', 'SELECT
language_code||\',\' FROM fnd_languages WHERE installed_f...') called at e:\ora
cle\prodcomn\admin\install\PROD_prodsrv\txkFrmUTF8.pl line 124
eval {...} called at e:\oracle\prodcomn\admin\install\PROD_prodsrv\txkFr
mUTF8.pl line 111
ERRORCODE = 1 ERRORCODE_END
.end std out.
.end err out.
the other error for txkGenExtSecConf.txt
Setting of Environment completed.
*******FATAL ERROR*******
PROGRAM : (e:\oracle\prodcomn\admin\install\PROD_prodsrv\txkGenExtSecConf.pl)
TIME : Sat Apr 24 21:50:15 2010
FUNCTION: TXK::IO::open [ Level 3 ]
MESSAGES:
error = Unable to open file
errorno = No such file or directory
file = <e:\oracle\prodcomn\temp\txkGenExtSecConf.txt
STACK TRACE
TXK::Error::abort('TXK::Error', 'HASH(0x9c4900)') called at e:\oracle\pr
odappl\au\11.5.0\perl/TXK/Common.pm line 299
TXK::Common::doError('TXK::IO=HASH(0x8f3cdc)', 'HASH(0x8f5ed0)', undef)
called at e:\oracle\prodappl\au\11.5.0\perl/TXK/Common.pm line 314
TXK::Common::setError('TXK::IO=HASH(0x8f3cdc)', 'HASH(0x8f5ed0)') called
at e:\oracle\prodappl\au\11.5.0\perl/TXK/IO.pm line 291
TXK::IO::open('TXK::IO=HASH(0x8f3cdc)', 'HASH(0x8f82c0)') called at e:\o
racle\prodcomn\admin\install\PROD_prodsrv\txkGenExtSecConf.pl line 212
eval {...} called at e:\oracle\prodcomn\admin\install\PROD_prodsrv\txkGe
nExtSecConf.pl line 66
ERRORCODE = 1 ERRORCODE_END
.end std out.
.end err out.
****************************************************

Similar Messages

  • FileUpload.AllowMultiple is not working in IE 10

    Hello 
    I have a ASP.NET application and using .NET framework 4.5..I'm using the file upload and allowing multiple selection of files. This works with google chrome but not IE 10 
      <td>                                                           
                                   <asp:FileUpload ID="fileUpload" runat="server" AllowMultiple="true" Height="22px" />    
                                    <asp:RequiredFieldValidator ID="rfv_fileUpload" runat="server" 
                                     ControlToValidate="fileUpload" ErrorMessage="File is required!" 
                                     Display="None"  ValidationGroup="UploadFile" /> 
                                </td>
    Is there any fix or patch for IE 10 to make it work , please advise?

    Please use the ASP.NET forums for ASP.NET related questions:
    http://forums.asp.net

  • FileUpload UI element -"browse"label is not coming in Hungrian for Hungrian

    Folks,
    We are using FileUpload ui element in our application, our application supports English , Hugrian languages, Problem is here , label on browse button coming in English for hungrian users.
    I believe  no need to add any translation to browse label in .xlf file,
    can any one tell me how to add Hungrian translation to Browse label, how to check standard translations of file upload ui element?
    Thanks & Regards,
    Veera.

    Hi Anup,
    portal User language is already hungray and rest of the labels in page are coming in hungrian as we maintained in -hu.xlf file.but for FileUpload ui element there is no option to map label of  "browse"  button with a message pool attribute.
    Thanks & Regards,
    Veera.

  • I am trying to use apache commons fileupload and get this error

    I am using tomcat 5.5 as application server and JDK 1.6,
    does anybody have idea how to resolve this error ?
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.security.AccessControlException: access denied (java.util.PropertyPermission java.io.tmpdir read)
         java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
         java.security.AccessController.checkPermission(AccessController.java:546)
         java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
         java.lang.System.getProperty(System.java:652)
         org.apache.commons.fileupload.disk.DiskFileItem.getTempFile(DiskFileItem.java:611)
         org.apache.commons.fileupload.disk.DiskFileItem.getOutputStream(DiskFileItem.java:556)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362)
         org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
         project.UploadFiles.processRequest(UploadFiles.java:48)
         project.UploadFiles.doPost(UploadFiles.java:107)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:597)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)

    Make sure that the servlet has permissions to write to that directory. I've hit that snag before, and on linux I set the permissions to nobody nobody 775.
    Good luck,
    Krista

  • Sending an email with attachments in Java using FileUpload UI Element

    Hello Experts,
    I'm using NWDS 7.01 SP6.
    I have an application that has a FileUpload ui element. The elements resource property is bound to a context node of type Resource from the Local Dictionary from uielementsdefinitions.
    The question I have is, how can I take the uploaded file from the context, and attach it to an email using the javax.mail.* api?
    Do I need to store it somewhere first or can it be taken directly from the context attribute? If I need to store it, where do I store it? 
    Any help or suggestions are appreciated.
    Thanks
    MM

    Hello Experts,
    I'm using NWDS 7.01 SP6.
    I have an application that has a FileUpload ui element. The elements resource property is bound to a context node of type Resource from the Local Dictionary from uielementsdefinitions.
    The question I have is, how can I take the uploaded file from the context, and attach it to an email using the javax.mail.* api?
    Do I need to store it somewhere first or can it be taken directly from the context attribute? If I need to store it, where do I store it? 
    Any help or suggestions are appreciated.
    Thanks
    MM

  • How to invoke the FileUpload field click event without clicking on the browse button?

    The Fileupload field click() method works in IE, but not in firefox. Can someone provide some details on this issue?

    A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
    The helpers at that forum are more knowledgeable about web development issues.
    You need to register at the mozillaZine forum site in order to post at that forum.
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Dynamic Error Message from a Bundle Showed in a rich:fileUpload

    Hello.
    There is a way to show a dynamic error message from a bundle (i.e, There is a problem in the word {0} in line {1}.) in a rich:fileUpload after the Managed Bean method in fileUploadListener="#{MyManagedBean.myMethod}" attribute was performed? That's because the error message parameters are discovered only after the MyManagedBean.myMethod execution.
    As far I know, I'm able only to show a static message with transferErrorLabel="#{myBundle.myErrorMessage}" attribute.
    Here is my rich:fileUpload component code:
      <rich:fileUpload id="upload"   
         fileUploadListener="#{PlanilhaManagedBean.importar}"  
         maxFilesQuantity="100" 
         immediateUpload="true" listHeight="130" acceptedTypes="xls"  
         addControlLabel="#{bundle.geralProcurarArquivo}" 
         ontyperejected="alert('#{bundle.geralExtensaoInvalida}')"    
         cancelEntryControlLabel="#{bundle.geralCancelar}" 
         clearAllControlLabel="#{bundle.geralLimparTudo}"     
         clearControlLabel="#{bundle.geralLimpar}" 
         doneLabel="#{bundle.geralArquivoTransferidoComSucesso}"  
         progressLabel="#{bundle.geralTransferindoArquivo}" 
         stopControlLabel="#{bundle.geralParar}"  
         stopEntryControlLabel="#{bundle.geralParar}" 
         transferErrorLabel="#{bundle.geralErroNaTransferenciaDoArquivo}" /> Any idea?
    Thanks in advance.

    Hi, BalusC. Thanks for your reply.
    I already tried that. I put a navigation-rule in faces-config.xml to the same page of the rich:fileUpload, but the rich:fileUpload component doesn't starts a get or a post request. So the navigation-rule is ignored and the page wasn't rendered again.
    I also tried to put the <a4j:support ...> in the rich:fileUpload to re-render the <h:messages ...> component, but didn't work too. The <h:messages ...> wasn't re-render.
    Thanks in advance.
    Edited by: reolca on May 10, 2009 5:40 AM

  • FileUpload problem: InputStream does not contain a serialized object

    Hi All,
    I'm using the FileUpload component in a JSPDynPage and the htmlb component seems to work fine but I cannot read the file (InputStream). I get the following error(IOException): "InputStream does not contain a serialized object".
    Please let me know what is wrong with my code. This is a part of the code I used:
    public FileInputStream sourceFileInput;
    public ObjectInputStream input;
    FileUpload fu;
    fu = (FileUpload) this.getComponentByName("myFileUpload");
    IFileParam fileParam = ((FileUpload) getComponentByName("myFileUpload")).getFile();
    File f       = fileParam.getFile();
    file         = fu.getFile().getFile();
    absolutepath = fu.getFile().getFile().getAbsolutePath();
    this.sourceFileInput = new FileInputStream(file);
    input = new ObjectInputStream(sourceFileInput);
    The last line of code seems to generate te error.

    Hi,
    I have found the answers, thank you both.
    (I included the examle code. Perhaps of some use to someone.)
    FileUpload fu;
    fu = null;
    fu = (FileUpload) this.getComponentByName("myFileUpload");
    //       this is the temporary file
    if (fu != null) {
         IFileParam fileParam = ((FileUpload) getComponentByName("myFileUpload")).getFile();
         if (fileParam != null) {
              // get info about this file and create a FileInputStream
              File f = fileParam.getFile();
              if (f != null) {
                   try {
                        fis = new FileInputStream(f);
                   // process exceptions opening files
                   catch (FileNotFoundException ex) {
                        myBean.setMessage(
                             "1" + f + ex.getLocalizedMessage());
                   isr = new InputStreamReader(fis);
                   br = new BufferedReader(isr);
    String textLine = "";
    do {
         try {
              textLine = (String) br.readLine();
         } catch (IOException e) {
              myBean.setMessage(
                   "1" + e.getLocalizedMessage());
         // Jco append table & put data into the record
         // (I_FILE is the table with txt data that is sent to the RFC)
         I_FILE.appendRow();     
         I_FILE.setValue(textLine, "REC");                              
    } while (textLine != null);

  • How to upload data in the pdf file to the R/3 with fileupload element ?....

    Hi Experts,
    I need to upload the data in the pdf file to the R/3 with fileupload element.
    But I am not able to get the correct data(it is confusion code) in the pdf file when I debug the programe. However, I am able to get the data if the data is in the txt or excel file.
    Do you give some hint for this problem ?
    Thanks & Regards,
    Tao

    Hi, experts,
    The version of R/3 : ABAP: 10, BASIS:11.
    Best regards,
    tao

  • FileUpload get filename and PATH?

    Hi everybody,
    is there a chance to get also the path from where to upload a file using the fileupload-UI?
    Thanks a lot
    Regards Mario

    Mario,
    No, this is not possible due to security restrictions imposed by browsers
    VS

  • Pre-fill the filename in Fileupload UI

    Hi,
    I am unable to pre-fill the filename in fileupoad UI.
    When I launch the WD app, on the browser it get the following URL
    http://devai063.private.xxxx.com:8081/sap/bc/webdynpro/sap/zgi_file_upload?sap-language=EN
    at the end I add &filename=c:benefit.txt and hit enter,
    http://devai063.private.xxxx.com:8081/sap/bc/webdynpro/sap/zgi_file_upload?sap-language=EN&filename=c:benefit.txt
    In WD window HANDLEDEFAULT method I am checking for the filename parameter if not empty I am setting the 'filename'  to the context of filename of fileuploadUI, but the app does not show the file name C:
    benefit.txt in the fileupload UI.
    I debugged the HANDLEDEFAULT and I can see the filename but somehow it is not setting to the filname for uploadfile UI.
    any advice is highly appreciated.
    Thanks,
    Ram

    From the online help:
    Technical Browser Details Beyond the Control of WDA
    Due to browser restrictions that are unrelated to Web Dynpro ABAP, the previously entered data path might disappear when a FileUpload UI element is clicked. In newer versions of the browser, it is therefore impossible to enter the file name in the entry field. The field always remains empty. The selection of the file name is therefore only possible in new browser versions using the Browse... button. You cannot enter the file name manually (using the keyboard or the Copy and Paste functions) or by setting the file name from the back end (directly or using context binding). For more details, read the security-related information in Internet Explorer 6 about handling <input type=file>.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/frameset.htm

  • Is there any way to get FileUpload.PosetedFile.Inputstream property as string?

    Hello,
    In my project i have used asp.net Fileupload control which works fine on my local machine. but when run that project on server i am not able to load the xls file. so i have used "Fileupload1.PostedFile.InputStream" property which returns as a Stream.
    By using this i can load excel file properly. but now i have to use as "string" instead of "stream" for further implementation. so how i can use "Fileupload1.PostedFile.InputStream" which returns Stream, and i can convert it into
    string and pass it to load excel file to run it properly on server also? can any one please help me?

    This forum is to discuss problems of C# development. Your question is not related to the topic of this forum.
    You'll need to post it in the dedicated ASP.Net Forum
    http://forums.asp.net for more efficient responses, where you can contact ASP.NET experts. Thanks for understanding.

  • Attachements with apache commons fileupload

    I'm using:
    http://commons.apache.org/fileupload/
    to write file on server side (Tomcat running on Windows with XP or 2003).
    I'm sending data to servlet with doPost() as follows:
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                DiskFileItemFactory factory = new DiskFileItemFactory();
                factory.setSizeThreshold(4096);
                factory.setRepository(new File("test"));
                ServletFileUpload upload = new ServletFileUpload(factory);
                upload.setSizeMax(1000000);
                List fileItems = upload.parseRequest(request);
                Iterator i = fileItems.iterator();
                String comment = ((FileItem) i.next()).getString();
                FileItem fi = (FileItem) i.next();
                String fileName = fi.getName();
                // db
                fi.write(new File("C:/", fileName));
            } catch (Exception ex) {
                out.print(ex.getMessage());
            out.close();
        }but it's response is:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    root cause
    java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
         org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:196)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:358)
         org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
         Upload.doPost(Upload.java:69)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    root cause
    java.lang.ClassNotFoundException: org.apache.commons.io.output.DeferredFileOutputStream
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
         org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:196)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:358)
         org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
         Upload.doPost(Upload.java:69)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.
    Apache Tomcat/6.0.16don't know why.. any ideas?

    java.lang.ClassNotFoundException: org.apache.commons.io.output.DeferredFileOutputStreamThe mentioned class is missing in the runtime classpath.
    Add it (in this specific case, the JAR file with the mentioned class) to the classpath and the problem will disappear.
    This class is part of Commons IO. Read the dependencies page at FileUpload user guide which JAR's you all need.

  • Fileupload broken in Firefox 3.6.3 Flash 10.0.45.2 Mac OS X

    I have been trying to get some basic file upload of an image working using Flex 4 and Flash 10, but when I upload an image drag and drop stops working in Firefox 3.6.3 on Mac OS X.
    After the fileupload loads the new PNG file, it displays correctly, but drag and drop events don't appear to propagate any more, and the app generally freezes up.  On some occasions the app starts working again until the next file upload.
    I tried calling the fileupload code without doing anything with the loaded file, and the problem still occurs.
    This exact code works as expected with Safari and Google Chrome (5.0.375.55) on Mac OS X.
    I don't think I am trying to do anything too complex - I do not have a workaround. Ultimately I want to store the images in a back end database etc., but there is no getting around the need for fileupload.  I have moved from Flex 3 / Flash 9 fileupload due to well documented and wide ranging problems.
    Any suggestions are welcome...
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                      creationComplete="init()">
         <s:layout>
              <s:HorizontalLayout/>
         </s:layout>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <fx:Script>
              <![CDATA[
                   import mx.collections.ArrayCollection;
                   import mx.controls.Alert;
                   import mx.core.IUIComponent;
                   import mx.events.DragEvent;
                   import mx.managers.DragManager;
                   import mx.rpc.AsyncToken;
                   import mx.rpc.events.FaultEvent;
                   import mx.rpc.events.ResultEvent;
                   [Bindable]
                   var listContent:ArrayCollection = new ArrayCollection();
                   private function init():void
                        listContent.addItem({heading1:"qwe", heading2:"qwew", heading3:"wwww"});
                        listContent.addItem({heading1:"sdasd", heading2:"asdasd", heading3:"asdsad"});
                        listContent.addItem({heading1:"zxcxc", heading2:"zxcxzc", heading3:"zxczxc"});
    // drag drop
                   private function dragEnterHandler(e:DragEvent):void {
                        DragManager.acceptDragDrop(e.currentTarget as IUIComponent);
                   private function dropHandler(event:DragEvent):void {
                        Alert.show("got the drop");
    // file uplaod stuff               
                   private var fileReference:FileReference = new FileReference();
                   private function uploadFile():void {
                        var fileFilter:FileFilter = new FileFilter("png","*.png");
                        fileReference.browse([fileFilter]);
                        fileReference.addEventListener(Event.SELECT, onFileSelected);
                        fileReference.addEventListener(Event.COMPLETE, onFileCompleted);
                   private function onFileSelected(event:Event):void {   
                        fileReference.load();
                   private function onFileCompleted(event:Event):void {
                        fileReference = event.currentTarget as FileReference;
                        var data:ByteArray = fileReference.data; 
                         background.source = fileReference.data;
              ]]>
         </fx:Script>
         <s:Scroller width="100%" height="100%" dragEnter="dragEnterHandler(event)" dragDrop="dropHandler(event)">
              <s:Group width="100%" height="100%">
                   <mx:Image id="background" />
              </s:Group>
         </s:Scroller>
         <s:Button label="Upload image" click="{uploadFile()}" />
         <mx:DataGrid dataProvider="{listContent}" dragEnabled="true">
              <mx:columns>
                   <mx:DataGridColumn headerText="Column 1" dataField="heading1"/>
                   <mx:DataGridColumn headerText="Column 2" dataField="heading2"/>
                   <mx:DataGridColumn headerText="Column 3" dataField="heading3"/>
              </mx:columns>
         </mx:DataGrid>
    </s:Application>

    Your best bet is to file a bug.

  • Com.sapportals.htmlb.FileUpload;

    Hi Experts,
    I am building this file upload utility.
    Following is my code"
    package com.xyz.ws.di;
    import java.io.Serializable;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import com.sapportals.htmlb.event.Event;
    import com.sapportals.htmlb.rendering.IPageContext;
    import com.sapportals.htmlb.rendering.PageContextFactory;
    import com.sapportals.htmlb.FileUpload;
    import com.sapportals.portal.prt.component.*;
    import com.sapportals.wcm.repository.AccessDeniedException;
    import com.sapportals.wcm.repository.Content;
    import com.sapportals.wcm.repository.ICollection;
    import com.sapportals.wcm.repository.IResource;
    import com.sapportals.wcm.repository.NotSupportedException;
    import com.sapportals.wcm.repository.ResourceContext;
    import com.sapportals.wcm.repository.ResourceException;
    import com.sapportals.wcm.repository.ResourceFactory;
    import com.sapportals.wcm.util.uri.RID;
    import com.sapportals.portal.security.usermanagement.IUser;
    public class FileUpload implements Serializable{
             protected IPortalComponentRequest request;
              protected IPortalComponentResponse response;
              protected IPortalComponentSession session;
              protected IPortalComponentContext context;
              protected IPortalComponentProfile profile;
              protected String userId;
              protected String fileName;
              private DAO DAO = null;
              private final static int INITIAL_STATE = 0;   
              private final static int ERROR_STATE = 1; 
              private int state = INITIAL_STATE;
              public void uploadUtility(IPortalComponentRequest request, IPortalComponentResponse response)
                   String mimetype;
                   String resourceName;
                   String repository;
                   FileInputStream sourceFileInput = null;
                   session = request.getComponentSession();
                   DAO = new DAO();
                   DAO = (DAO)session.getValue("DAO");
                   IUser epUser=DAO.getEpUser();
                   System.err.println("berry + Getting Iuser from inside UploadUtility SAI  " + epUser);
              /*     IWDClientUser wdUser = WDClientUser.getCurrentUser();
                   IUser user = wdUser.wdUser.getSAPUser(); */
              //     IUser epUser=(IUser)request.getUser().getUser();
                   System.err.println("epUser - " + epUser);
                   ResourceContext ctx = new ResourceContext(epUser);
                   repository = "/Folder1/new";
                   RID rid=RID.getRID(repository);
                   System.err.println("getting RID :- " + rid);
                   IPageContext context = PageContextFactory.createPageContext(request,response);
              //     PageContext context = PageContextFactory.createPageContext(request, response);
                   Event event=context.getCurrentEvent();
                   if(null!=event)
                        String event_name=event.getAction();
                        if(null!=event_name && event_name.trim().equalsIgnoreCase("upload_file"))
                              FileUpload fileUpload = (FileUpload)context.getComponentForId("fileupload");
                                  if(null !=fileUpload && null!=fileUpload.getFile())
                                            mimetype = fileUpload.getFile().getContentType();
                                            resourceName = fileUpload.getFile().getFileName();
                                            System.err.println("resourceName inside fileUploadUtility :- " + resourceName);
                                            //sourceFileInput = new FileInputStream(fileUpload.getFile().getFile().getAbsolutePath());
                                            fileName = resourceName;
                                            System.err.println("filename :- " + fileName);
                                            try {
                                                 sourceFileInput = new FileInputStream(fileUpload.getFile().getFile().getAbsolutePath());
                                            } catch (FileNotFoundException fnf) {
                                                 state = ERROR_STATE;
                                                 System.err.print("FileNotFoundException Occured " + fnf.toString());
                                            Content content = new Content(sourceFileInput, mimetype, -1L);
                                            IResource resource = null;
                                            try {
                                                 resource =(IResource) (ResourceFactory.getInstance().getResource(rid, ctx));
                                            } catch (ResourceException resexp) {
                                                 state = ERROR_STATE;
                                                 System.err.print("Resource Exception Occured for IResource" + resexp.toString());      
                                            ICollection aCollection=(ICollection)resource;
                                            //IResource newResource = aCollection.createResource(resourceName, null, content);
                                            try {
                                                 IResource newResource = (IResource) aCollection.createResource(resourceName, null, content);
                                            } catch (NotSupportedException e2) {
                                                 state = ERROR_STATE;
                                                 System.err.print("Not Supported Exception Occured" + e2.toString());
                                            } catch (AccessDeniedException e2) {
                                                 state = ERROR_STATE;
                                                 System.err.print("Access Denied Exception Occured" + e2.toString());
                                            } catch (ResourceException e2) {
                                                 state = ERROR_STATE;
                                                 System.err.print("Resource Exception Occured for ICollection" + e2.toString());      
                                            }//end of catch
                             }//end of innermost if
                   }//end of 2nd if
              }//end of 1st If
              DAO.setFileName(fileName);
              DAO.setState(state);
              session.putValue("DAO", DAO);
           }// end of uploadUtil
    I am getting a complie error in my NWDS at the following line:
    FileUpload fileUpload = (FileUpload)context.getComponentForId("fileupload");
    The error is : Cannot cast from component to FileUpload.
    Also, I am getting an error on the following Import statement:
    import com.sapportals.htmlb.FileUpload;
    The error is : The import import com.sapportals.htmlb.FileUpload conflicts with a type defined in the same file.
    Any Idea why this would be happening?
    Thanks
    S.B

    import com.sapportals.htmlb.FileUpload;
    is conflicting with the class name. Both are same.
    Change the class name.
    Thread closed.

Maybe you are looking for