Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This can have a lot of possible causes (also see the comments I posted).</p> <ul> <li>External JS is not loaded.</li> <li>JS code is syntactically/logically invalid.</li> <li>Request URL is invalid.</li> <li>Servlet is not mapped at all.</li> <li>Servlet is mapped on wrong <code>url-pattern</code>.</li> <li>Servlet failed to start/init.</li> </ul> <p>It's hard to naildown the root cause based on the as far given information.</p> <p>As you mentioned that you didn't see any request been fired in the "Net" tab of FireBug, I think that the JS code is simply syntactically/logically invalid. Rightclick page and doubleverify generated/printed JS code.</p> <p><strong>Update:</strong> I tried to reproduce your problem.</p> <ol> <li><p>I downloaded <a href="http://www.uploadify.com/_files/jquery.uploadify-v2.1.0.zip" rel="noreferrer">jquery.uploadify-v2.1.0 (MIT)</a>, extracted it and put the entire contents in the <code>/WebContent/uploadify</code> folder of my (empty) playground web project in Eclipse.</p></li> <li><p>I created a <code>/WebContent/upload.jsp</code> file as follows:</p> <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;title&gt;Uploadify test&lt;/title&gt; &lt;script src="uploadify/jquery-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script src="uploadify/swfobject.js"&gt;&lt;/script&gt; &lt;script src="uploadify/jquery.uploadify.v2.1.0.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#uploadify').uploadify({ 'uploader': 'uploadify/uploadify.swf', 'script': 'uploadServlet', 'folder': '/uploads', 'cancelImg': 'uploadify/cancel.png' }); $('#upload').click(function() { $('#uploadify').uploadifyUpload(); return false; }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input id="uploadify" type="file"&gt; &lt;a id="upload" href="#"&gt;Upload&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre></li> <li><p>I created a <code>com.example.UploadServlet</code> as follows with little help of <a href="http://commons.apache.org/fileupload" rel="noreferrer">Apache Commons FileUpload</a> (just placed <a href="http://mirrors.kahuki.com/apache/commons/fileupload/binaries/commons-fileupload-1.2.1-bin.zip" rel="noreferrer"><code>commons-fileupload-1.2.1.jar</code></a> and <a href="http://www.alliedquotes.com/mirrors/apache/commons/io/binaries/commons-io-1.4-bin.zip" rel="noreferrer"><code>commons-io-1.4.jar</code></a> in <code>/WEB-INF/lib</code>):</p> <pre class="lang-java prettyprint-override"><code>package com.example; import java.io.IOException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; public class UploadServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("UploadServlet invoked. Here are all uploaded files: "); try { List&lt;FileItem&gt; items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request); for (FileItem item : items) { if (!item.isFormField()) { System.out.println("Name: " + item.getName()); System.out.println("Size: " + item.getSize()); System.out.println("Type: " + item.getContentType()); } } } catch (Exception e) { throw new ServletException(e); } } } </code></pre></li> <li><p>I registered <code>com.example.UploadServlet</code> in <code>web.xml</code> as follows:</p> <pre class="lang-xml prettyprint-override"><code>&lt;servlet&gt; &lt;servlet-name&gt;uploadServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;com.example.UploadServlet&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;uploadServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/uploadServlet&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre></li> <li><p>I deployed the project, started the server, went to <a href="http://localhost:8080/playground/upload.jsp" rel="noreferrer">http://localhost:8080/playground/upload.jsp</a>, selected a random big file from my downloads folder, clicked the <code>Upload</code> link, see the upload percentage counter growing to 100% and I finally see the following in the stdout:</p> <pre> UploadServlet invoked. Here are all uploaded files: Name: glassfish-v3-windows.exe Size: 50402555 Type: application/octet-stream </pre></li> </ol> <p>I'm sorry to say, I can't reproduce your problem. At least, the above information should help you to get started "freshly". Hope it helps.</p> <p><strong>Update:</strong> as per the comments, the filter expects that it is using the same session. Ok, you can do this fairly easy by changing</p> <pre><code>'&lt;%= request.getContextPath() %&gt;/uploadFile?portletId=${portletId}&amp;remoteFolder=&lt;%= decodedString %&gt;',"; </code></pre> <p>to</p> <pre><code>'&lt;%= request.getContextPath() %&gt;/uploadFile;jsessionid=${pageContext.session.id}?portletId=${portletId}&amp;remoteFolder=&lt;%= decodedString %&gt;',"; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload