Results 1 to 4 of 4

Thread: File Upload with SWF

  1. #1
    Join Date
    Nov 2007
    Location
    Vienna
    Posts
    21

    Default File Upload with SWF

    Hi,

    can anybody give me a hint, how can I integrate fileupload with SWF 2.0

    I didn't find anything in the API and the documentation

    br
    Vassil Nikolov

  2. #2
    Join Date
    Nov 2008
    Posts
    742

    Default

    Haven't tried it myself, but I think that's out of SWF's scope. I would imagine that would be handled by whatever other framework you're using with SWF. That includes JSF, Spring MVC, and Portlets, so far.

  3. #3
    Join Date
    Jul 2008
    Location
    Medellín, Colombia
    Posts
    135

    Default

    I think this fall out of scope of SWF but if you're using tomahawk..

    it would be a good idea to look at this code:

    Code:
    	<!--
    		the Extensions Filter adds the code and URL needed to provide those
    		resources to the generated HTML Tomahawk Settings
    	-->
    	<filter>
    		<filter-name>MyFacesExtensionsFilter</filter-name>
    		<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
    		<init-param>
    			<param-name>uploadMaxFileSize</param-name>
    			<param-value>5m</param-value>
    			<description>Set the size limit for uploaded files. Format: 10 -
    				10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB </description>
    			<init-param>
    				<description>Set the path where the intermediary files will be
    					stored.</description>
    				<param-name>uploadRepositoryPath</param-name>
    				<param-value>/WEB-INF/upload</param-value>
    				<param-name>uploadThresholdSize</param-name>
    				<param-value>100k</param-value>
    			</init-param>
    		</init-param>
    	</filter>
    	<!--
    		extension mapping for adding <script/>, <link/>, and other resource
    		tags to JSF-pages
    	-->
    	<filter-mapping>
    		<filter-name>MyFacesExtensionsFilter</filter-name>
    		<!--
    			servlet-name must match the name of your
    			javax.faces.webapp.FacesServlet entry
    		-->
    		<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    	</filter-mapping>

    mapping the filter to the Spring MVC Dispatcher servlet and not to the faces servlet..


    <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>

  4. #4
    Join Date
    Nov 2007
    Location
    Vienna
    Posts
    21

    Default

    Hi,

    thx for help I have create the file upload. but I am using richfaces:

    In web.xml add
    Code:
    	<filter>
    		<display-name>RichFaces Filter</display-name>
    		<filter-name>richfaces</filter-name>
    		<filter-class>org.ajax4jsf.Filter</filter-class>
    		<init-param>
    	        <param-name>createTempFiles</param-name>
    	        <param-value>false</param-value>
    		</init-param>
    		<init-param>
    	        <param-name>maxRequestSize</param-name>
    	        <param-value>1000000</param-value>
    		</init-param>
    	</filter>
    	<filter-mapping>
    		<filter-name>richfaces</filter-name>
    		<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    		<dispatcher>REQUEST</dispatcher>
    		<dispatcher>FORWARD</dispatcher>
    		<dispatcher>INCLUDE</dispatcher>
    	</filter-mapping>
    and in your xhtml file copy the code from the live demo:

    Code:
                <rich:fileUpload fileUploadListener="#{fileUploadBean.listener}" maxFilesQuantity="#{fileUploadBean.uploadsAvailable}"
                    id="upload" immediateUpload="#{fileUploadBean.autoUpload}" acceptedTypes="jpg, gif, png, bmp" allowFlash="#{fileUploadBean.useFlash}" />
    br
    Vassil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •