Kawai Wiki

Compare Revisions

Ignore whitespace Rev 144 → Rev 145

/trunk/src/main/java/org/kawai/action/FileAction.java
10,8 → 10,9
import org.kawai.dao.PageDAO;
import org.kawai.dao.UserDAO;
import org.mentawai.core.ApplicationManager;
import org.mentawai.filter.AuthenticationFree;
 
public class FileAction extends AbstractAction {
public class FileAction extends AbstractAction implements AuthenticationFree {
private static final String UPLOAD_DIR = "uploads";
19,6 → 20,12
super(userDAO, pageDAO);
}
@Override
public boolean bypassAuthentication(String method) {
if (method != null && method.equals("upload")) return false;
return false;
}
private String getFolderFromName(String name) {
name = name.toLowerCase();
if (name.endsWith(".jpg") || name.endsWith(".gif") || name.endsWith(".jpeg") || name.endsWith(".png")) {
/trunk/src/main/webapp/show_page.jsp
76,9 → 76,10
$('#file_upload').uploadify({
'uploader' : '<mtw:contextPath />/uploadify/uploadify.swf',
'script' : '<mtw:contextPath />/File.upload.mtw',
'script' : '<mtw:contextPath />/File.upload.mtw;jsessionid=<%= session.getId() %>',
'cancelImg' : '<mtw:contextPath />/uploadify/cancel.png',
'folder' : '<mtw:contextPath />/uploads',
'scriptData': { 'JSESSIONID': '<%= session.getId() %>'},
'auto' : true,
'multi' : true,
'onComplete' : function(event, ID, fileObj, response, data) {