Merge branch 'master' of http://118.219.150.34:50501/DBNT/FAISP
|
|
@ -1,23 +1,35 @@
|
||||||
package com.dbnt.faisp.config;
|
package com.dbnt.faisp.config;
|
||||||
|
|
||||||
import com.dbnt.faisp.main.faRpt.service.FaRptService;
|
import com.dbnt.faisp.main.faRpt.service.FaRptService;
|
||||||
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.service.FishingBoatService;
|
||||||
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.service.SailorService;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affair.service.AffairService;
|
import com.dbnt.faisp.main.fpiMgt.affair.service.AffairService;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.service.PlanService;
|
import com.dbnt.faisp.main.fpiMgt.affairPlan.service.PlanService;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService;
|
import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService;
|
||||||
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.BoardInvestigationService;
|
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.BoardInvestigationService;
|
||||||
import com.dbnt.faisp.main.publicBoard.service.PublicBoardService;
|
import com.dbnt.faisp.main.publicBoard.service.PublicBoardService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.core.io.FileSystemResource;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/file")
|
||||||
public class FileController {
|
public class FileController {
|
||||||
|
|
||||||
private final FaRptService faRptService;
|
private final FaRptService faRptService;
|
||||||
|
|
@ -26,13 +38,55 @@ public class FileController {
|
||||||
private final AffairService affairService;
|
private final AffairService affairService;
|
||||||
private final ResultService resultService;
|
private final ResultService resultService;
|
||||||
private final BoardInvestigationService boardInvestigationService;
|
private final BoardInvestigationService boardInvestigationService;
|
||||||
|
private final FishingBoatService fishingBoatService;
|
||||||
|
|
||||||
@GetMapping("/file/fileDownload")
|
@GetMapping("/fileDisplay")
|
||||||
|
public ResponseEntity<Resource> fileDisplay(HttpServletRequest request,
|
||||||
|
HttpServletResponse response,
|
||||||
|
String board,
|
||||||
|
Integer parentKey,
|
||||||
|
Integer fileSeq) {
|
||||||
|
FileInfo fileInfo = getFileInfo(board, parentKey, fileSeq);
|
||||||
|
String pathStr = fileInfo.getSavePath()+fileInfo.getConvNm();
|
||||||
|
Resource resource = new FileSystemResource(pathStr);
|
||||||
|
if(!resource.exists()){
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
HttpHeaders header = new HttpHeaders();
|
||||||
|
Path filePath = null;
|
||||||
|
try {
|
||||||
|
filePath = Paths.get(pathStr);
|
||||||
|
header.add("Content-type", Files.probeContentType(filePath));
|
||||||
|
}catch (IOException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return new ResponseEntity<Resource>(resource, header, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
@GetMapping("/fileDownload")
|
||||||
public void fileDownload(HttpServletRequest request,
|
public void fileDownload(HttpServletRequest request,
|
||||||
HttpServletResponse response,
|
HttpServletResponse response,
|
||||||
String board,
|
String board,
|
||||||
Integer parentKey,
|
Integer parentKey,
|
||||||
Integer fileSeq) {
|
Integer fileSeq) {
|
||||||
|
|
||||||
|
FileInfo fileInfo = getFileInfo(board, parentKey, fileSeq);
|
||||||
|
BufferedInputStream in;
|
||||||
|
BufferedOutputStream out;
|
||||||
|
try {
|
||||||
|
File file = new File(fileInfo.getSavePath(), fileInfo.getConvNm());
|
||||||
|
|
||||||
|
setDisposition(fileInfo.getFullName(), request, response);
|
||||||
|
in = new BufferedInputStream(new FileInputStream(file));
|
||||||
|
out = new BufferedOutputStream(response.getOutputStream());
|
||||||
|
FileCopyUtils.copy(in, out);
|
||||||
|
out.flush();
|
||||||
|
if(out!=null) out.close();
|
||||||
|
if(in!=null )in.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private FileInfo getFileInfo(String board, Integer parentKey, Integer fileSeq){
|
||||||
FileInfo downloadFile = null;
|
FileInfo downloadFile = null;
|
||||||
switch (board){
|
switch (board){
|
||||||
case "faRpt":
|
case "faRpt":
|
||||||
|
|
@ -53,23 +107,11 @@ public class FileController {
|
||||||
case "ivsgt":
|
case "ivsgt":
|
||||||
downloadFile = boardInvestigationService.selectIvsgtFile(parentKey, fileSeq);
|
downloadFile = boardInvestigationService.selectIvsgtFile(parentKey, fileSeq);
|
||||||
break;
|
break;
|
||||||
|
case "sailor":
|
||||||
|
downloadFile = fishingBoatService.selectSailorFile(parentKey, fileSeq);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
return downloadFile;
|
||||||
BufferedInputStream in;
|
|
||||||
BufferedOutputStream out;
|
|
||||||
try {
|
|
||||||
File file = new File(downloadFile.getSavePath(), downloadFile.getConvNm());
|
|
||||||
|
|
||||||
setDisposition(downloadFile.getFullName(), request, response);
|
|
||||||
in = new BufferedInputStream(new FileInputStream(file));
|
|
||||||
out = new BufferedOutputStream(response.getOutputStream());
|
|
||||||
FileCopyUtils.copy(in, out);
|
|
||||||
out.flush();
|
|
||||||
if(out!=null) out.close();
|
|
||||||
if(in!=null )in.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void setDisposition(String filename, HttpServletRequest request, HttpServletResponse response) throws IOException {
|
private void setDisposition(String filename, HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||||
String browser = getBrowser(request);
|
String browser = getBrowser(request);
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,9 @@ public class SecurityConfig{
|
||||||
.exceptionHandling()
|
.exceptionHandling()
|
||||||
.accessDeniedHandler(accessDeniedHandler())
|
.accessDeniedHandler(accessDeniedHandler())
|
||||||
.authenticationEntryPoint(authenticationEntryPoint());
|
.authenticationEntryPoint(authenticationEntryPoint());
|
||||||
|
// 나모 에디터 'X-Frame-Options' to 'DENY' 오류로 인하여 추가.
|
||||||
|
// https://computer-science-student.tistory.com/497
|
||||||
|
http.headers().frameOptions().sameOrigin();
|
||||||
return http.build();
|
return http.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,8 @@ import com.dbnt.faisp.main.faStatistics.crackdownsStatus.service.FishingBoatServ
|
||||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@ -96,8 +94,10 @@ public class FishingBoatController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/saveFishingBoat")
|
@PostMapping("/saveFishingBoat")
|
||||||
public Integer saveFishingBoat(@AuthenticationPrincipal UserInfo loginUser, CrackdownStatus crackdownStatus){
|
public Integer saveFishingBoat(@AuthenticationPrincipal UserInfo loginUser,
|
||||||
return fishingBoatService.saveCrackdownStatus(crackdownStatus);
|
CrackdownStatus crackdownStatus,
|
||||||
|
MultipartHttpServletRequest request){
|
||||||
|
return fishingBoatService.saveCrackdownStatus(crackdownStatus, request.getMultiFileMap().get("uploadFiles"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/checkCaseNum")
|
@GetMapping("/checkCaseNum")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.config.FileInfo;
|
||||||
|
import lombok.*;
|
||||||
|
import org.hibernate.annotations.DynamicInsert;
|
||||||
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@NoArgsConstructor
|
||||||
|
@DynamicInsert
|
||||||
|
@DynamicUpdate
|
||||||
|
@IdClass(CaptinPhotoVersion.CaptinPhotoVersionId.class)
|
||||||
|
@Table(name = "captin_photo_version")
|
||||||
|
public class CaptinPhotoVersion extends FileInfo {
|
||||||
|
@Id
|
||||||
|
@Column(name = "sailor_key")
|
||||||
|
private Integer sailorKey;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "file_seq")
|
||||||
|
private Integer fileSeq;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "version_no")
|
||||||
|
private Integer versionNo;
|
||||||
|
|
||||||
|
@Column(name = "orig_nm")
|
||||||
|
private String origNm;
|
||||||
|
|
||||||
|
@Column(name = "conv_nm")
|
||||||
|
private String convNm;
|
||||||
|
|
||||||
|
@Column(name = "file_extn")
|
||||||
|
private String fileExtn;
|
||||||
|
|
||||||
|
@Column(name = "file_size")
|
||||||
|
private String fileSize;
|
||||||
|
|
||||||
|
@Column(name = "save_path")
|
||||||
|
private String savePath;
|
||||||
|
|
||||||
|
|
||||||
|
@Embeddable
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class CaptinPhotoVersionId implements Serializable {
|
||||||
|
private Integer sailorKey;
|
||||||
|
private Integer fileSeq;
|
||||||
|
private Integer versionNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat;
|
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat;
|
||||||
|
|
||||||
import com.dbnt.faisp.config.BaseModel;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.DynamicInsert;
|
import org.hibernate.annotations.DynamicInsert;
|
||||||
import org.hibernate.annotations.DynamicUpdate;
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor;
|
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.Violation;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.Violation;
|
||||||
|
|
@ -56,4 +57,7 @@ public class Sailor extends SailorBaseEntity {
|
||||||
private String boatNameKr;
|
private String boatNameKr;
|
||||||
@Transient
|
@Transient
|
||||||
private LocalDateTime napoDt;
|
private LocalDateTime napoDt;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private List<CaptinPhotoFile> fileList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,4 +83,5 @@ public class SailorBaseEntity extends BaseModel {
|
||||||
@Column(name = "wrt_dt")
|
@Column(name = "wrt_dt")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||||
private LocalDateTime wrtDt;
|
private LocalDateTime wrtDt;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor;
|
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
|
||||||
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoVersion;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
@ -8,6 +10,7 @@ import org.hibernate.annotations.DynamicUpdate;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
@ -49,4 +52,7 @@ public class SailorVersion extends SailorBaseEntity {
|
||||||
private CrackdownStatus crackdownStatus;
|
private CrackdownStatus crackdownStatus;
|
||||||
@Transient
|
@Transient
|
||||||
private FishingBoat fishingBoat;
|
private FishingBoat fishingBoat;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private List<CaptinPhotoVersion> fileList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface CaptionPhotoFileRepository extends JpaRepository<CaptinPhotoFile, CaptinPhotoFile.CaptinPhotoFileId> {
|
public interface CaptionPhotoFileRepository extends JpaRepository<CaptinPhotoFile, CaptinPhotoFile.CaptinPhotoFileId> {
|
||||||
|
|
||||||
|
List<CaptinPhotoFile> findBySailorKeyOrderByFileSeqAsc(Integer sailorKey);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoVersion;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface CaptionPhotoVersionRepository extends JpaRepository<CaptinPhotoVersion, CaptinPhotoVersion.CaptinPhotoVersionId> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,10 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus.service;
|
||||||
|
|
||||||
|
|
||||||
import com.dbnt.faisp.config.BaseService;
|
import com.dbnt.faisp.config.BaseService;
|
||||||
|
import com.dbnt.faisp.config.FileInfo;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.mapper.CrackdownStatusMapper;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.mapper.CrackdownStatusMapper;
|
||||||
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
|
||||||
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoVersion;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatusVersion;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatusVersion;
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
|
||||||
|
|
@ -16,12 +19,16 @@ import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.SailorVers
|
||||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository.*;
|
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository.*;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|
@ -38,6 +45,8 @@ public class FishingBoatService extends BaseService {
|
||||||
private final ProcessResultVersionRepository processResultVersionRepository;
|
private final ProcessResultVersionRepository processResultVersionRepository;
|
||||||
private final SailorRepository sailorRepository;
|
private final SailorRepository sailorRepository;
|
||||||
private final SailorVersionRepository sailorVersionRepository;
|
private final SailorVersionRepository sailorVersionRepository;
|
||||||
|
private final CaptionPhotoFileRepository captionPhotoFileRepository;
|
||||||
|
private final CaptionPhotoVersionRepository captionPhotoVersionRepository;
|
||||||
|
|
||||||
public List<CrackdownStatus> selectFishingBoatList(CrackdownStatus crackdownStatus){
|
public List<CrackdownStatus> selectFishingBoatList(CrackdownStatus crackdownStatus){
|
||||||
return crackdownStatusMapper.selectFishingBoatList(crackdownStatus);
|
return crackdownStatusMapper.selectFishingBoatList(crackdownStatus);
|
||||||
|
|
@ -54,14 +63,17 @@ public class FishingBoatService extends BaseService {
|
||||||
crackdownStatus.setViolationList(violationRepository.findByFbKey(crackdownStatus.getFishingBoat().getFbKey()));
|
crackdownStatus.setViolationList(violationRepository.findByFbKey(crackdownStatus.getFishingBoat().getFbKey()));
|
||||||
crackdownStatus.setSailorList(sailorRepository.findByFbKey(crackdownStatus.getFishingBoat().getFbKey()));
|
crackdownStatus.setSailorList(sailorRepository.findByFbKey(crackdownStatus.getFishingBoat().getFbKey()));
|
||||||
for(Sailor sailor: crackdownStatus.getSailorList()){
|
for(Sailor sailor: crackdownStatus.getSailorList()){
|
||||||
//첨부파일 ...?
|
if(sailor.getPosition().equals("POS001")){
|
||||||
|
// 선장의 첨부파일 첨부
|
||||||
|
sailor.setFileList(captionPhotoFileRepository.findBySailorKeyOrderByFileSeqAsc(sailor.getSailorKey()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return crackdownStatus;
|
return crackdownStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Integer saveCrackdownStatus(CrackdownStatus crackdownStatus) {
|
public Integer saveCrackdownStatus(CrackdownStatus crackdownStatus, List<MultipartFile> sailorFiles) {
|
||||||
Integer cdsKey, fbKey;
|
Integer cdsKey, fbKey;
|
||||||
if (crackdownStatus.getCdsKey()==null || crackdownStatus.getCdsKey().equals(0)){
|
if (crackdownStatus.getCdsKey()==null || crackdownStatus.getCdsKey().equals(0)){
|
||||||
// 최초 등록시 단속현황, 처리현황, 선원정보를 같이 등록.
|
// 최초 등록시 단속현황, 처리현황, 선원정보를 같이 등록.
|
||||||
|
|
@ -106,19 +118,25 @@ public class FishingBoatService extends BaseService {
|
||||||
processResultVersionRepository.save(processResultVersion);
|
processResultVersionRepository.save(processResultVersion);
|
||||||
// 선원정보, 선원정보버전 저장.
|
// 선원정보, 선원정보버전 저장.
|
||||||
List<Sailor> sailorList = crackdownStatus.getSailorList();
|
List<Sailor> sailorList = crackdownStatus.getSailorList();
|
||||||
List<SailorVersion> sailorVersionList = new ArrayList<>();
|
|
||||||
i = 1;
|
|
||||||
for(Sailor sailor: sailorList){
|
for(Sailor sailor: sailorList){
|
||||||
sailor.setSailorKey(i++);
|
|
||||||
sailor.setFbKey(fbKey);
|
sailor.setFbKey(fbKey);
|
||||||
|
|
||||||
SailorVersion sailorVersion = new SailorVersion();
|
SailorVersion sailorVersion = new SailorVersion();
|
||||||
|
|
||||||
|
Integer sailorKey = sailorRepository.save(sailor).getSailorKey();
|
||||||
|
|
||||||
BeanUtils.copyProperties(sailor, sailorVersion);
|
BeanUtils.copyProperties(sailor, sailorVersion);
|
||||||
sailorVersion.setVersionNo(1);
|
sailorVersion.setVersionNo(1);
|
||||||
sailorVersionList.add(sailorVersion);
|
sailorVersion.setSailorKey(sailorKey);
|
||||||
|
Integer versionNo = sailorVersionRepository.save(sailorVersion).getVersionNo();
|
||||||
|
if(sailor.getPosition().equals("POS001")){
|
||||||
|
//선장은 사진이 같이 업로드 됨.
|
||||||
|
if(sailorFiles.size()>0) {
|
||||||
|
saveCaptainPhoto(sailorKey, versionNo, sailorFiles);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sailorRepository.saveAll(sailorList);
|
|
||||||
sailorVersionRepository.saveAll(sailorVersionList);
|
|
||||||
}else{
|
}else{
|
||||||
// 업데이트시에는 어선정보만 수정.
|
// 업데이트시에는 어선정보만 수정.
|
||||||
cdsKey = crackdownStatus.getCdsKey();
|
cdsKey = crackdownStatus.getCdsKey();
|
||||||
|
|
@ -160,8 +178,14 @@ public class FishingBoatService extends BaseService {
|
||||||
return fishingBoat;
|
return fishingBoat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FileInfo selectSailorFile(Integer sailorKey, Integer fileSeq) {
|
||||||
|
return captionPhotoFileRepository.findById(new CaptinPhotoFile.CaptinPhotoFileId(sailorKey, fileSeq)).orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
private CrackdownStatus setWriteInfo(CrackdownStatus crackdownStatus){
|
private CrackdownStatus setWriteInfo(CrackdownStatus crackdownStatus){
|
||||||
FishingBoat fishingBoat = crackdownStatus.getFishingBoat();
|
FishingBoat fishingBoat = crackdownStatus.getFishingBoat();
|
||||||
|
fishingBoat.setWrtDt(LocalDateTime.now());
|
||||||
|
|
||||||
crackdownStatus.setWrtOrgan(fishingBoat.getWrtOrgan());
|
crackdownStatus.setWrtOrgan(fishingBoat.getWrtOrgan());
|
||||||
crackdownStatus.setWrtPart(fishingBoat.getWrtPart());
|
crackdownStatus.setWrtPart(fishingBoat.getWrtPart());
|
||||||
crackdownStatus.setWrtUserSeq(fishingBoat.getWrtUserSeq());
|
crackdownStatus.setWrtUserSeq(fishingBoat.getWrtUserSeq());
|
||||||
|
|
@ -186,4 +210,32 @@ public class FishingBoatService extends BaseService {
|
||||||
}
|
}
|
||||||
return crackdownStatus;
|
return crackdownStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Value("${file.dir.sailor}")
|
||||||
|
protected String sailorPath;
|
||||||
|
|
||||||
|
private void saveCaptainPhoto(Integer sailorKey, Integer versionNo, List<MultipartFile> fileList){
|
||||||
|
int fileSeq = 1;
|
||||||
|
for(MultipartFile file : fileList){
|
||||||
|
String saveName = UUID.randomUUID().toString();
|
||||||
|
String path = locationPath+ File.separator+sailorPath+File.separator;
|
||||||
|
saveFile(file, new File(path+File.separator+saveName));
|
||||||
|
|
||||||
|
String originalFilename = file.getOriginalFilename();
|
||||||
|
int extnIdx = originalFilename.lastIndexOf(".");
|
||||||
|
CaptinPhotoFile fileInfo = new CaptinPhotoFile();
|
||||||
|
fileInfo.setSailorKey(sailorKey);
|
||||||
|
fileInfo.setFileSeq(fileSeq++);
|
||||||
|
fileInfo.setOrigNm(originalFilename.substring(0, extnIdx));
|
||||||
|
fileInfo.setFileExtn(originalFilename.substring(extnIdx+1));
|
||||||
|
fileInfo.setConvNm(saveName);
|
||||||
|
fileInfo.setFileSize(calculationSize(file.getSize()));
|
||||||
|
fileInfo.setSavePath(path);
|
||||||
|
CaptinPhotoVersion versionInfo = new CaptinPhotoVersion();
|
||||||
|
BeanUtils.copyProperties(fileInfo, versionInfo);
|
||||||
|
versionInfo.setVersionNo(versionNo);
|
||||||
|
captionPhotoFileRepository.save(fileInfo);
|
||||||
|
captionPhotoVersionRepository.save(versionInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ file.dir=C:\\faispUploadFiles
|
||||||
file.dir.vulnerable=/vulnerable
|
file.dir.vulnerable=/vulnerable
|
||||||
file.dir.part=/part
|
file.dir.part=/part
|
||||||
file.dir.equip=/equip
|
file.dir.equip=/equip
|
||||||
|
file.dir.sailor=sailor
|
||||||
|
file.dir.affair=affair
|
||||||
|
|
||||||
|
|
||||||
#thymeleaf
|
#thymeleaf
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
NamoCrossUploader 설치방법
|
||||||
|
|
||||||
|
Server
|
||||||
|
압축을 풀고 WEB-INF 폴더의 jar파일을 서버에 설치하시고 샘플페이지(NamoCrossUploaderJaSamples)를 참고해 주시기 바랍니다.
|
||||||
|
페이지 적용 방법은 샘플페이지(NamoCrossUploaderJaSamples)를 참고하여 적용하시면 됩니다.
|
||||||
|
|
||||||
|
Html5
|
||||||
|
서버에 임의의 폴더 생성 후 NamoCrossUploader_H5_Samples폴더의 파일을 모두 복사하여 붙여 넣습니다.
|
||||||
|
페이지 적용 방법은 샘플페이지(NamoCrossUploader_H5_Samples) 를 참고해 주시기 바랍니다.
|
||||||
|
|
||||||
|
참고로 amoCrossUploaderJaManua, NamoCrossUploaderH5Manuall폴더는 개발자 가이드 입니다.
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
Manifest-Version: 1.0
|
||||||
|
Class-Path:
|
||||||
|
|
||||||
|
|
@ -0,0 +1,136 @@
|
||||||
|
/* ----------------- COMMON (/)----------------- */
|
||||||
|
|
||||||
|
body {
|
||||||
|
padding:0;
|
||||||
|
font-family:굴림,Gulim,AppleGothic,sans-serif;
|
||||||
|
color:#626262;
|
||||||
|
font-size:12px;
|
||||||
|
line-height:18px;
|
||||||
|
background-position:left top;
|
||||||
|
background-repeat:repeat-x;
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
|
||||||
|
scrollbar-3dlight-color:C9C9C9;
|
||||||
|
scrollbar-arrow-color:C9C9C9;
|
||||||
|
scrollbar-base-color:F5F5F5;
|
||||||
|
scrollbar-darkshadow-color:FFFFFF;
|
||||||
|
scrollbar-face-color:F5F5F5;
|
||||||
|
scrollbar-highlight-color:FFFFF;
|
||||||
|
scrollbar-shadow-color:C9C9C9;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*html{overflow-y:scroll;}*/
|
||||||
|
form {margin:0;}
|
||||||
|
img{border:0 none;}
|
||||||
|
|
||||||
|
|
||||||
|
a:link, a:visited{color:#3D3D3D; text-decoration:none;}
|
||||||
|
a:hover, a:active{color:#3D3D3D; text-decoration:underline;}
|
||||||
|
|
||||||
|
h1 { font-family:굴림; font-size:24px; color:#485285; margin-left:0pt; line-height:150%; }
|
||||||
|
h2 { font-family:굴림; font-size:15px; color:#485285; margin-left:10pt; }
|
||||||
|
h3 { font-family:굴림; font-size:14px; color:#000066; margin-left:10pt; margin-top:30pt; }
|
||||||
|
h4 { font-family:굴림; font-size:12px; color:#000066; margin-left:10pt;}
|
||||||
|
h5 { font-family:굴림; font-size:12px; color:#4673A0; margin-left:10pt; margin-top:20pt; }
|
||||||
|
h6 { font-family:굴림; font-size:12px; color:#4673A0; margin-left:10pt; }
|
||||||
|
|
||||||
|
div,p{font-family:굴림; font-size:12px; line-height:18px; padding:0; margin:0; border:0;}
|
||||||
|
th,td{font-family:굴림; font-size:12px; line-height:15px; padding:0; margin:0; border:0; }
|
||||||
|
ul,li,ol,dl,dt,dd{font-family:굴림; font-size:12px; line-height:18px; padding:0; margin:0; border:0;}
|
||||||
|
hr{padding:0; margin-top:30; border:1px; border-style:solid; border-color:#C2CDD4; border-bottom-color:#ffffff; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Tab & Button */
|
||||||
|
.clearfix:after,
|
||||||
|
.btn-area:after {content:""; display:block; height:0; clear:both; visibility:hidden;}
|
||||||
|
.clearfix, .btn-area {}
|
||||||
|
|
||||||
|
ul.navi-tab {clear:both; width:100%; margin:0px 0px 0px 0px; background:url('images/table_navi_bg.png') repeat-x left bottom;}
|
||||||
|
ul.navi-tab li {float:left; background:url('images/navibg_left.png') no-repeat left top; height:50px;}
|
||||||
|
ul.navi-tab li span {float:left; margin:0 0 0 45px; padding:15px 45px 10px 0; background:url('images/navibg_right.png') no-repeat right top; font-weight:bold; color:#8c7d70; word-spacing:-2px; height:50px;}
|
||||||
|
ul.navi-tab li.on {background:url('images/navibg_left_on.png') no-repeat left top; height:50px;}
|
||||||
|
ul.navi-tab li.on span {background:url('images/navibg_right_on.png') no-repeat right top; color:#282828;background-size:166px 50px;}
|
||||||
|
ul.navi-tab li span a:link, ul.navi-tab li span a:visited, ul.navi-tab li span a:active {color:#595959; text-decoration:none;}
|
||||||
|
ul.navi-tab li span a:hover {color:#282828; text-decoration:none;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***** Head *****/
|
||||||
|
#head_title{background-image:url(images/header_bg.png); background-color:#FFFFFF;}
|
||||||
|
#h1_title{margin:0 auto; padding:0px 0 0 0; width:100%; height:43px; text-align:left;}
|
||||||
|
#h1_title h1{font-size:1px; text-decoration:none; text-indent:-10000px; padding:0;}
|
||||||
|
#h1_title h2{font-size:1px; text-decoration:none; text-indent:-10000px; padding:0;}
|
||||||
|
#h1_title.logo h1{float:left; width:216px; height:43px; background-image:url(images/title_bi.png);}
|
||||||
|
#h1_title.logo h2{float:right; width:200px; height:43px; background-image:url(images/title_ci.png);}
|
||||||
|
|
||||||
|
#h1_title p{float:left; padding:0px 0px 0px 0px;}
|
||||||
|
#h1_title p img{cursor:pointer;}
|
||||||
|
|
||||||
|
#head_menu{margin:0px 0px 0px 17px auto; height:30px; float:left;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***** Tree *****/
|
||||||
|
.ctbic { font-family:굴림,Arial; font-weight:bold; font-size:9pt; margin-top:15pt;}
|
||||||
|
.ctmid { font-family:굴림,Arial; font-weight:bold; font-size:9pt; margin-top:5pt; margin-bottom:0pt; margin-left:10pt;}
|
||||||
|
.ctsmall { font-family:굴림,Arial; font-size:9pt; margin-top:3pt; margin-bottom:0pt; margin-left:10pt;}
|
||||||
|
.ctsmall2 { font-family:굴림,Arial; font-size:9pt; margin-top:0pt; margin-bottom:0pt; margin-left:30pt; color:rgb(0,102,153);}
|
||||||
|
|
||||||
|
/***** API Tree *****/
|
||||||
|
.cu_obj_guide { font-family:굴림,Arial; font-weight:bold; font-size:9pt; margin-top:15pt;}
|
||||||
|
.cu_obj { font-family:굴림,Arial; font-weight:bold; font-size:9pt; margin-top:5pt; margin-bottom:0pt; margin-left:10pt;}
|
||||||
|
.cu_obj_api { font-family:굴림,Arial; font-weight:bold; font-size:9pt; margin-top:5pt; margin-bottom:0pt; margin-left:20pt;}
|
||||||
|
.cu_obj_api_name { font-family:굴림,Arial; font-size:9pt; margin-top:3pt; margin-bottom:0pt; margin-left:30pt;}
|
||||||
|
|
||||||
|
|
||||||
|
/***** Body *****/
|
||||||
|
.mtitle_table { margin-left:10pt; margin-top:30pt; margin-bottom:9pt; border-width:1px; border-color:rgb(204,204,204); border-style:solid;}
|
||||||
|
.mtitle { font-family:굴림; font-weight:bold; font-size:12pt; }
|
||||||
|
.mtab { font-family:굴림; font-weight:bold; font-size:12pt; margin-left:20pt;}
|
||||||
|
.mtext { font-family:굴림; font-size:9pt; margin-left:10pt; margin-right:10pt; line-height:120%; margin-bottom:0pt; margin-bottom:10pt;}
|
||||||
|
.mlabel1 { font-family:굴림; font-weight:bold; font-size:9pt; color:rgb(51,102,153); margin-left:20pt;}
|
||||||
|
.mlabel2 { font-family:굴림; font-size:9pt; color:rgb(0,102,153);}
|
||||||
|
.mlabeltext { font-family:굴림; font-size:9pt; margin-left:20pt; line-height:150%; margin-top:0pt; margin-bottom:5pt;}
|
||||||
|
.msub { font-family:굴림; font-weight:bold; font-size:9pt; color:rgb(153,0,0); margin-left:20pt;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***** 관리자 도움말 API *****/
|
||||||
|
p { font-family:굴림,Arial; font-size:9pt; }
|
||||||
|
li { font-family:굴림,Arial; font-size:9pt; }
|
||||||
|
dd { font-family:굴림,Arial; font-size:9pt; line-height:150%; }
|
||||||
|
|
||||||
|
h1 { font-family:굴림,Arial, Verdana; font-size:16pt; color:rgb(72, 82, 133); }
|
||||||
|
h2 { font-family:바탕,Arial; font-size:14pt; color:blue; margin-left:20pt; }
|
||||||
|
h3 { font-family:굴림,Arial; font-size:12pt; color:rgb(70, 115, 160); margin-top:40pt; margin-left:20pt; }
|
||||||
|
h4 { font-family:굴림,Arial; font-size:11pt; color:blue; margin-left:20pt; margin-top:20pt; }
|
||||||
|
h5 { font-family:돋움,Arial; font-size:10pt; color:000066; margin-left:20pt; }
|
||||||
|
h6 { font-family:바탕,Arial; font-size:10pt; color:blue; margin-left:20pt; }
|
||||||
|
|
||||||
|
.menu { font-family:돋움,Arial; font-size:9pt; color:rgb(0,102,153); }
|
||||||
|
.order { font-family: 굴림,Arial; font-size:9pt; color:rgb(153,153,153); }
|
||||||
|
td.border { border-width:1pt; border-color:rgb(153,153,153); border-style:solid; }
|
||||||
|
|
||||||
|
.mtitle { font-family:굴림,Arial; font-weight:bold; font-size:14pt; }
|
||||||
|
.mtitle_table { margin-left:17pt; margin-top:30pt; margin-bottom:9pt; border-width:1px; border-color:rgb(204,204,204); border-style:solid;}
|
||||||
|
.mtab { font-family:굴림,Arial; font-size:9pt; margin-left:20pt; line-height:150%; margin-top:0pt; margin-bottom:5pt;}
|
||||||
|
.mtext { font-family:굴림,Arial; font-size:9pt; margin-left:20pt; line-height:150%; margin-top:0pt; margin-bottom:5pt;}
|
||||||
|
.mlabel1 { font-family:굴림,Arial; font-weight:bold; font-size:9pt; color:rgb(51,102,153); margin-left:20pt;}
|
||||||
|
.mlabel2 { font-family:굴림,Arial; font-size:9pt; color:rgb(0,102,153);}
|
||||||
|
.mlabeltext { font-family:굴림,Arial; font-size:9pt; margin-left:45pt; line-height:150%; margin-top:0pt; margin-bottom:5pt;}
|
||||||
|
.msub { font-family:굴림,Arial; font-weight:bold; font-size:9pt; color:rgb(153,0,0); margin-left:20pt;}
|
||||||
|
|
||||||
|
|
||||||
|
i { color:fuchsia; }
|
||||||
|
|
||||||
|
body{
|
||||||
|
scrollbar-3dlight-color:9B9B9B;
|
||||||
|
scrollbar-arrow-color:ffffff;
|
||||||
|
scrollbar-base-color:E2E2E2;
|
||||||
|
scrollbar-darkshadow-color:FFFFFF;
|
||||||
|
scrollbar-face-color:E2E2E2;
|
||||||
|
scrollbar-highlight-color:FFFFF;
|
||||||
|
scrollbar-shadow-color:9B9B9B}
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>onCancelUploadItem</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Events</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>onCancelUploadItem</h2>
|
||||||
|
<p class="dscrpt">개별 파일에 대한 업로드 취소 시 호출됩니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">onCancelUploadItem</span> ( String <span class="paraname">params</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">params</span></p>
|
||||||
|
<p class="paradsc">[out] 취소된 파일정보로 JSON 타입의 String입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
<b>[namocrossuploader-config.js]</b>
|
||||||
|
(function (win) {
|
||||||
|
|
||||||
|
if (!location.origin)
|
||||||
|
location.origin = location.protocol + "//" + location.host;
|
||||||
|
|
||||||
|
var namoCrossUploaderEvents = new Object();
|
||||||
|
namoCrossUploaderEvents.onStartUpload = "onStartUploadCu"; // 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onStartUploadItem = "onStartUploadItemCu"; // 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUploadItem = "onEndUploadItemCu"; // 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUpload = "onEndUploadCu"; // 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCloseMonitorWindow = "onCloseMonitorWindowCu"; // 전송창이 닫힐 때 호출됩니다.
|
||||||
|
<b>namoCrossUploaderEvents.onCancelUploadItem = "onCancelUploadItemCu"; // 개별 파일에 대한 업로드 취소 시 호출됩니다.</b>
|
||||||
|
namoCrossUploaderEvents.onException = "onExceptionCu"; // 예외 발생 시 호출됩니다
|
||||||
|
|
||||||
|
win.namoCrossUploaderConfig = {
|
||||||
|
|
||||||
|
// 제품버전
|
||||||
|
version: "1.0.0.1",
|
||||||
|
|
||||||
|
// 제품경로
|
||||||
|
productPath: location.origin + "/cu/NamoCrossUploader_jsp_H5_Samples/Samples/",
|
||||||
|
|
||||||
|
// Event 이름 설정
|
||||||
|
eventNames: namoCrossUploaderEvents
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
})(window);
|
||||||
|
|
||||||
|
<b>[UploadForm.html]</b>
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var <b>onCancelUploadItemCu</b> = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert('[개별 파일에 대한 업로드 취소 정보]\n' +
|
||||||
|
'FileName : ' + obj.fileName + '\n' +
|
||||||
|
'FileSize : ' + obj.fileSize + '\n'
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>onCloseMonitorWindow</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Events</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>onCloseMonitorWindow</h2>
|
||||||
|
<p class="dscrpt">전송창이 닫힐 때 호출됩니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">onCloseMonitorWindow</span> ( )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname"></span></p>
|
||||||
|
<p class="paradsc"></p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
<b>[namocrossuploader-config.js]</b>
|
||||||
|
/*
|
||||||
|
* NamoCrossUploader configuration file.
|
||||||
|
* Copyright NAMO Editor Inc.
|
||||||
|
*/
|
||||||
|
(function (win) {
|
||||||
|
|
||||||
|
if (!location.origin)
|
||||||
|
location.origin = location.protocol + "//" + location.host;
|
||||||
|
|
||||||
|
var namoCrossUploaderEvents = new Object();
|
||||||
|
namoCrossUploaderEvents.onStartUpload = "onStartUploadCu"; // 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onStartUploadItem = "onStartUploadItemCu"; // 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUploadItem = "onEndUploadItemCu"; // 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUpload = "onEndUploadCu"; // 업로드 완료 시 호출됩니다.
|
||||||
|
<b>namoCrossUploaderEvents.onCloseMonitorWindow = "onCloseMonitorWindowCu"; // 전송창이 닫힐 때 호출됩니다.</b>
|
||||||
|
namoCrossUploaderEvents.onCancelUploadItem = "onCancelUploadItemCu"; // 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onException = "onExceptionCu"; // 예외 발생 시 호출됩니다
|
||||||
|
|
||||||
|
win.namoCrossUploaderConfig = {
|
||||||
|
|
||||||
|
// 제품버전
|
||||||
|
version: "1.0.0.1",
|
||||||
|
|
||||||
|
// 제품경로
|
||||||
|
productPath: location.origin + "/cu/NamoCrossUploader_jsp_H5_Samples/Samples/",
|
||||||
|
|
||||||
|
// Event 이름 설정
|
||||||
|
eventNames: namoCrossUploaderEvents
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
})(window);
|
||||||
|
|
||||||
|
<b>[UploadForm.html]</b>
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
<b>var onEndUploadItemCu = function (rowIndex) {</b>
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert("[" + rowIndex + "번째 파일의 정보]\n" +
|
||||||
|
"FileType : " + obj.fileType + " (NORMAL:파일, UPLOADED:업로드된 파일)\n" +
|
||||||
|
"FileId : " + obj.fileId + "\n" +
|
||||||
|
"FileName : " + obj.fileName + "\n" +
|
||||||
|
"FileSize : " + obj.fileSize + "\n" +
|
||||||
|
"Status : " + obj.status + "\n" +
|
||||||
|
"IsDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"FileType, FileId, IsDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt">
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,100 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>onEndUpload</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Events</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>onEndUpload</h2>
|
||||||
|
<p class="dscrpt">업로드 완료 시 호출됩니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">onEndUpload</span> ( )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname"></span></p>
|
||||||
|
<p class="paradsc"></p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
<b>[namocrossuploader-config.js]</b>
|
||||||
|
/*
|
||||||
|
* NamoCrossUploader configuration file.
|
||||||
|
* Copyright NAMO Editor Inc.
|
||||||
|
*/
|
||||||
|
(function (win) {
|
||||||
|
|
||||||
|
if (!location.origin)
|
||||||
|
location.origin = location.protocol + "//" + location.host;
|
||||||
|
|
||||||
|
var namoCrossUploaderEvents = new Object();
|
||||||
|
namoCrossUploaderEvents.onStartUpload = "onStartUploadCu"; // 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onStartUploadItem = "onStartUploadItemCu"; // 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUploadItem = "onEndUploadItemCu"; // 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
<b>namoCrossUploaderEvents.onEndUpload = "onEndUploadCu"; // 업로드 완료 시 호출됩니다.</b>
|
||||||
|
namoCrossUploaderEvents.onCloseMonitorWindow = "onCloseMonitorWindowCu"; // 전송창이 닫힐 때 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCancelUploadItem = "onCancelUploadItemCu"; // 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onException = "onExceptionCu"; // 예외 발생 시 호출됩니다
|
||||||
|
|
||||||
|
win.namoCrossUploaderConfig = {
|
||||||
|
|
||||||
|
// 제품버전
|
||||||
|
version: "1.0.0.1",
|
||||||
|
|
||||||
|
// 제품경로
|
||||||
|
productPath: location.origin + "/cu/NamoCrossUploader_jsp_H5_Samples/Samples/",
|
||||||
|
|
||||||
|
// Event 이름 설정
|
||||||
|
eventNames: namoCrossUploaderEvents
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
})(window);
|
||||||
|
|
||||||
|
<b>[UploadForm.html]</b>
|
||||||
|
/**
|
||||||
|
* 업로드 완료 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onEndUploadCu = function () {
|
||||||
|
// alert('업로드가 완료됐습니다.');
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt">
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>onEndUploadItem</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Events</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>onEndUploadItem</h2>
|
||||||
|
<p class="dscrpt">개별 파일에 대한 업로드 완료 시 호출됩니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">onEndUploadItem</span> ( String <span class="paraname">params</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">params</span></p>
|
||||||
|
<p class="paradsc">[out] 전송 완료된 파일정보로 JSON 타입의 String입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
<b>[namocrossuploader-config.js]</b>
|
||||||
|
/*
|
||||||
|
* NamoCrossUploader configuration file.
|
||||||
|
* Copyright NAMO Editor Inc.
|
||||||
|
*/
|
||||||
|
(function (win) {
|
||||||
|
|
||||||
|
if (!location.origin)
|
||||||
|
location.origin = location.protocol + "//" + location.host;
|
||||||
|
|
||||||
|
var namoCrossUploaderEvents = new Object();
|
||||||
|
namoCrossUploaderEvents.onStartUpload = "onStartUploadCu"; // 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onStartUploadItem = "onStartUploadItemCu"; // 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
<b>namoCrossUploaderEvents.onEndUploadItem = "onEndUploadItemCu"; // 개별 파일에 대한 업로드 완료 시 호출됩니다. </b>
|
||||||
|
namoCrossUploaderEvents.onEndUpload = "onEndUploadCu"; // 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCloseMonitorWindow = "onCloseMonitorWindowCu"; // 전송창이 닫힐 때 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCancelUploadItem = "onCancelUploadItemCu"; // 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onException = "onExceptionCu"; // 예외 발생 시 호출됩니다
|
||||||
|
|
||||||
|
win.namoCrossUploaderConfig = {
|
||||||
|
|
||||||
|
// 제품버전
|
||||||
|
version: "1.0.0.1",
|
||||||
|
|
||||||
|
// 제품경로
|
||||||
|
productPath: location.origin + "/cu/NamoCrossUploader_jsp_H5_Samples/Samples/",
|
||||||
|
|
||||||
|
// Event 이름 설정
|
||||||
|
eventNames: namoCrossUploaderEvents
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
})(window);
|
||||||
|
|
||||||
|
<b>[UploadForm.html]</b>
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
<b>var onEndUploadItemCu = function (rowIndex) {</b>
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert("[" + rowIndex + "번째 파일의 정보]\n" +
|
||||||
|
"FileType : " + obj.fileType + " (NORMAL:파일, UPLOADED:업로드된 파일)\n" +
|
||||||
|
"FileId : " + obj.fileId + "\n" +
|
||||||
|
"FileName : " + obj.fileName + "\n" +
|
||||||
|
"FileSize : " + obj.fileSize + "\n" +
|
||||||
|
"Status : " + obj.status + "\n" +
|
||||||
|
"IsDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"FileType, FileId, IsDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,113 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>onException</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Events</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>onException</h2>
|
||||||
|
<p class="dscrpt">예외 발생 시 호출됩니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">onException</span> ( String <span class="paraname">params</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">params</span></p>
|
||||||
|
<p class="paradsc">[out] 예외정보로 JSON 타입의 String입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
<b>[namocrossuploader-config.js]</b>
|
||||||
|
/*
|
||||||
|
* NamoCrossUploader configuration file.
|
||||||
|
* Copyright NAMO Editor Inc.
|
||||||
|
*/
|
||||||
|
(function (win) {
|
||||||
|
|
||||||
|
if (!location.origin)
|
||||||
|
location.origin = location.protocol + "//" + location.host;
|
||||||
|
|
||||||
|
var namoCrossUploaderEvents = new Object();
|
||||||
|
namoCrossUploaderEvents.onStartUpload = "onStartUploadCu"; // 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onStartUploadItem = "onStartUploadItemCu"; // 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUploadItem = "onEndUploadItemCu"; // 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUpload = "onEndUploadCu"; // 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCloseMonitorWindow = "onCloseMonitorWindowCu"; // 전송창이 닫힐 때 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCancelUploadItem = "onCancelUploadItemCu"; // 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
<b>namoCrossUploaderEvents.onException = "onExceptionCu"; // 예외 발생 시 호출됩니다 </b>
|
||||||
|
|
||||||
|
win.namoCrossUploaderConfig = {
|
||||||
|
|
||||||
|
// 제품버전
|
||||||
|
version: "1.0.0.1",
|
||||||
|
|
||||||
|
// 제품경로
|
||||||
|
productPath: location.origin + "/cu/NamoCrossUploader_jsp_H5_Samples/Samples/",
|
||||||
|
|
||||||
|
// Event 이름 설정
|
||||||
|
eventNames: namoCrossUploaderEvents
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
})(window);
|
||||||
|
|
||||||
|
<b>[UploadForm.html]</b>
|
||||||
|
/**
|
||||||
|
* 예외 발생 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onExceptionCu = function () {
|
||||||
|
// 300~ : 일반적 예외
|
||||||
|
// 400~ : 시스템 예외
|
||||||
|
// 500~ : 서측에서 발생한 예외
|
||||||
|
// 필요한 예외정보만 고객에서 보여주십시오.
|
||||||
|
var exceptionInfo = uploader.getLastExceptionInfo();
|
||||||
|
var obj = jQuery.parseJSON(exceptionInfo);
|
||||||
|
alert('[예외 정보]\n' + 'code : ' + obj.code + '\n' + 'message : ' + obj.message + '\n' + 'detailMessage : ' + obj.detailMessage);
|
||||||
|
|
||||||
|
if (parseInt(obj.code, 10) > 400000) {
|
||||||
|
var uploadedFilesInfo = uploader.getUploadedFilesInfo();
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.action = "ErrorProcess.jsp";
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>onStartUpload</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Events</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>onStartUpload</h2>
|
||||||
|
<p class="dscrpt">업로드 시작 시 호출됩니다. </p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">onStartUpload</span> ( )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname"></span></p>
|
||||||
|
<p class="paradsc"></p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
<b>[namocrossuploader-config.js]</b>
|
||||||
|
/*
|
||||||
|
* NamoCrossUploader configuration file.
|
||||||
|
* Copyright NAMO Editor Inc.
|
||||||
|
*/
|
||||||
|
(function (win) {
|
||||||
|
|
||||||
|
if (!location.origin)
|
||||||
|
location.origin = location.protocol + "//" + location.host;
|
||||||
|
|
||||||
|
var namoCrossUploaderEvents = new Object();
|
||||||
|
<b>namoCrossUploaderEvents.onStartUpload = "onStartUploadCu"; // 업로드 시작 시 호출됩니다. </b>
|
||||||
|
namoCrossUploaderEvents.onStartUploadItem = "onStartUploadItemCu"; // 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUploadItem = "onEndUploadItemCu"; // 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUpload = "onEndUploadCu"; // 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCloseMonitorWindow = "onCloseMonitorWindowCu"; // 전송창이 닫힐 때 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCancelUploadItem = "onCancelUploadItemCu"; // 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onException = "onExceptionCu"; // 예외 발생 시 호출됩니다
|
||||||
|
|
||||||
|
win.namoCrossUploaderConfig = {
|
||||||
|
|
||||||
|
// 제품버전
|
||||||
|
version: "1.0.0.1",
|
||||||
|
|
||||||
|
// 제품경로
|
||||||
|
productPath: location.origin + "/cu/NamoCrossUploader_jsp_H5_Samples/Samples/",
|
||||||
|
|
||||||
|
// Event 이름 설정
|
||||||
|
eventNames: namoCrossUploaderEvents
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
})(window);
|
||||||
|
|
||||||
|
<b>[UploadForm.html]</b>
|
||||||
|
/**
|
||||||
|
* 사용자 정의 업로드
|
||||||
|
*/
|
||||||
|
var onStartUpload = function () {
|
||||||
|
//alert("onStartUpload : 업로드가 시적되었습니다.");
|
||||||
|
uploader.startUpload();
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt">
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>onStartUploadItem</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Events</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>onStartUploadItem</h2>
|
||||||
|
<p class="dscrpt">개별 파일에 대한 업로드 시작 시 호출됩니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">onStartUploadItem</span> ( String <span class="paraname">params</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">params</span></p>
|
||||||
|
<p class="paradsc">[out] 전송 시작된 파일정보로 JSON 타입의 String입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
<b>[namocrossuploader-config.js]</b>
|
||||||
|
/*
|
||||||
|
* NamoCrossUploader configuration file.
|
||||||
|
* Copyright NAMO Editor Inc.
|
||||||
|
*/
|
||||||
|
(function (win) {
|
||||||
|
|
||||||
|
if (!location.origin)
|
||||||
|
location.origin = location.protocol + "//" + location.host;
|
||||||
|
|
||||||
|
var namoCrossUploaderEvents = new Object();
|
||||||
|
namoCrossUploaderEvents.onStartUpload = "onStartUploadCu"; // 업로드 시작 시 호출됩니다.
|
||||||
|
<b>namoCrossUploaderEvents.onStartUploadItem = "onStartUploadItemCu"; // 개별 파일에 대한 업로드 시작 시 호출됩니다. </b>
|
||||||
|
namoCrossUploaderEvents.onEndUploadItem = "onEndUploadItemCu"; // 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onEndUpload = "onEndUploadCu"; // 업로드 완료 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCloseMonitorWindow = "onCloseMonitorWindowCu"; // 전송창이 닫힐 때 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onCancelUploadItem = "onCancelUploadItemCu"; // 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
namoCrossUploaderEvents.onException = "onExceptionCu"; // 예외 발생 시 호출됩니다
|
||||||
|
|
||||||
|
win.namoCrossUploaderConfig = {
|
||||||
|
|
||||||
|
// 제품버전
|
||||||
|
version: "1.0.0.1",
|
||||||
|
|
||||||
|
// 제품경로
|
||||||
|
productPath: location.origin + "/cu/NamoCrossUploader_jsp_H5_Samples/Samples/",
|
||||||
|
|
||||||
|
// Event 이름 설정
|
||||||
|
eventNames: namoCrossUploaderEvents
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
})(window);
|
||||||
|
|
||||||
|
<b>[UploadForm.html]</b>
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onStartUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert("[" + rowIndex + "번째 파일의 정보]\n" +
|
||||||
|
"FileType : " + obj.fileType + " (NORMAL:파일, UPLOADED:업로드된 파일)\n" +
|
||||||
|
"FileId : " + obj.fileId + "\n" +
|
||||||
|
"FileName : " + obj.fileName + "\n" +
|
||||||
|
"FileSize : " + obj.fileSize + "\n" +
|
||||||
|
"Status : " + obj.status + "\n" +
|
||||||
|
"IsDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"FileType, FileId, IsDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>addUploadedFile</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>addUploadedFile</h2>
|
||||||
|
<p class="dscrpt">게시판 수정모드시 기존에 업로드된 파일을 추가합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">addUploadedFile</span> ( Object <span class="paraname">fileInfo</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">fileInfo</span></p>
|
||||||
|
<p class="paradsc">[in] 기존에 업로드된 파일정보입니다. 파일정보는 fileId, fileName, fileSize 입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* NamoCrossUploader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
var uploadUrl = 'UploadProcess.jsp';
|
||||||
|
var managerProperties = new Object();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 기존에 업로드 된 파일정보 추가
|
||||||
|
*/
|
||||||
|
for(var i=1; i<4; i++) {
|
||||||
|
var uploadedFileInfo = new Object();
|
||||||
|
uploadedFileInfo.fileId = 'FILEID_000' + i.toString();
|
||||||
|
uploadedFileInfo.fileName = '테스트 업로드 파일 0' + i.toString() + '.txt';
|
||||||
|
uploadedFileInfo.fileSize = '10240';
|
||||||
|
|
||||||
|
<b>uploader.addUploadedFile(JSON.stringify(uploadedFileInfo));</b>
|
||||||
|
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>getModifiedFilesInfo</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>getModifiedFilesInfo</h2>
|
||||||
|
<p class="dscrpt">게시판 수정모드시 addUploadedFile 메소드로 추가한 파일정보를 반환합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>String <span class="fname">getModifiedFilesInfo</span> ( String <span class="paraname">type</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">type</span></p>
|
||||||
|
<p class="paradsc">[in] 가져올 데이터 타입입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt">addUploadedFile 메소드로 추가한 파일정보를 String 타입으로 반환합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt">서버측에서 JSON 타입으로 반환했을 경우는 JSON 타입으로 가져오는 것을 권장하며, 그 외의 경우는 개별 파일 정보를 조합할 delimiter 문자(또는 문자열)를 입력해 주십시오.</P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* 전송창이 닫힐 때 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onCloseMonitorWindowCu = function () {
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
// onEndUploadCu 나 onCloseMonitorWindowCu 이벤트 시점에 처리하시면 되며,
|
||||||
|
// onCloseMonitorWindowCu 시에는 getUploadStatus()를 호출하여 업로드 완료되어 있는지 체크해 주십시오.
|
||||||
|
if (uploader.getUploadStatus() == 'COMPLETION') {
|
||||||
|
|
||||||
|
// 업로드된 전체 파일의 정보를 가져옵니다.
|
||||||
|
var uploadedFilesInfo = uploader.getUploadedFilesInfo();
|
||||||
|
var modifiedFilesInfo = uploader.<b>getModifiedFilesInfo(JSON)</b>;
|
||||||
|
/**
|
||||||
|
* 필요 시, 아래처럼 사용해 주십시오. (JSON으로 넘오올 경우)
|
||||||
|
var obj = jQuery.parseJSON(uploadedFilesInfo);
|
||||||
|
alertTimeout(obj.length);
|
||||||
|
alertTimeout(obj[0].name);
|
||||||
|
*/
|
||||||
|
//alert(uploadedFilesInfo);
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.modifiedFilesInfo.value = modifiedFilesInfo;
|
||||||
|
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>getTotalFileCount</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>getTotalFileCount</h2>
|
||||||
|
<p class="dscrpt">BasicFileUploadManager 객체에 추가된 전체 파일의 개수를 반환합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>Number <span class="fname">getTotalFileCount</span> ()</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname"></span></p>
|
||||||
|
<p class="paradsc"></p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt">BasicFileUploadManager 객체에 추가된 전체 파일의 개수를 반환합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* 파일의 정보를 가져옵니다.
|
||||||
|
*/
|
||||||
|
var getFilesInfo = function () {
|
||||||
|
var totalFileCount = uploader.<b>getTotalFileCount</b>();
|
||||||
|
|
||||||
|
if(totalFileCount == 0){
|
||||||
|
alert("파일이 목록에 없습니다.");
|
||||||
|
}else{
|
||||||
|
|
||||||
|
for (i = 0; i < totalFileCount; i++) {
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(i));
|
||||||
|
alert("[" + i + "번째 파일의 정보]\n" +
|
||||||
|
"fileType : " + obj.fileType + " (NORMAL:파일 UPLOADED:업로드된 파일)\n" +
|
||||||
|
"fileId : " + obj.fileId + "\n" +
|
||||||
|
"fileName : " + obj.fileName + "\n" +
|
||||||
|
"fileSize : " + obj.fileSize + "\n" +
|
||||||
|
"status : " + obj.status + "\n" +
|
||||||
|
"isDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"fileType, fileId, isDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>getUploadStatus</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>getUploadStatus</h2>
|
||||||
|
<p class="dscrpt">업로드 상태를 반환합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>String <span class="fname">getUploadStatus</span> ( )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname"></span></p>
|
||||||
|
<p class="paradsc"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt">업로드 상태를 String 타입으로 반환합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<table class="paradsc2" border="1" cellspacing="0" width="300" bordercolordark="white" bordercolorlight="#999999">
|
||||||
|
<tr>
|
||||||
|
<td width="75" bgcolor="#EEEEEE">
|
||||||
|
<p align="center">COMPLETE</p>
|
||||||
|
</td>
|
||||||
|
<td width="215">
|
||||||
|
<p>전송 완료 상태입니다.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="75" bgcolor="#EEEEEE">
|
||||||
|
<p align="center">WAIT</p>
|
||||||
|
</td>
|
||||||
|
<td width="215">
|
||||||
|
<p>전송 대기 상태입니다.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="75" bgcolor="#EEEEEE">
|
||||||
|
<p align="center">TRANSFER</p>
|
||||||
|
</td>
|
||||||
|
<td width="215">
|
||||||
|
<p>전송 중 상태입니다.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="75" bgcolor="#EEEEEE">
|
||||||
|
<p align="center">FAILURE</p>
|
||||||
|
</td>
|
||||||
|
<td width="215">
|
||||||
|
<p>전송 실패 상태입니다.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* 전송창이 닫힐 때 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onCloseMonitorWindowCu = function () {
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
// onEndUploadCu 나 onCloseMonitorWindowCu 이벤트 시점에 처리하시면 되며,
|
||||||
|
// onCloseMonitorWindowCu 시에는 getUploadStatus()를 호출하여 업로드 완료되어 있는지 체크해 주십시오.
|
||||||
|
if (uploader.<b>getUploadStatus</b>() == 'COMPLETION') {
|
||||||
|
|
||||||
|
// 업로드된 전체 파일의 정보를 가져옵니다.
|
||||||
|
var uploadedFilesInfo = uploader.getUploadedFilesInfo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 필요 시, 아래처럼 사용해 주십시오. (JSON으로 넘오올 경우)
|
||||||
|
var obj = jQuery.parseJSON(uploadedFilesInfo);
|
||||||
|
alertTimeout(obj.length);
|
||||||
|
alertTimeout(obj[0].name);
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>getUploadedFilesInfo</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>getUploadedFilesInfo</h2>
|
||||||
|
<p class="dscrpt">업로드된 전체 파일정보를 반환합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>String <span class="fname">getUploadedFilesInfo</span> ( String <span class="paraname">type</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">type</span></p>
|
||||||
|
<p class="paradsc">[in] 가져올 데이터 타입입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt">업로드된 전체 파일정보를 String 타입으로 반환합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt">서버측에서 JSON 타입으로 반환했을 경우는 JSON 타입으로 가져오는 것을 권장하며, 그 외의 경우는 개별 파일 정보를 조합할 delimiter 문자(또는 문자열)를 입력해 주십시오.</P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* 전송창이 닫힐 때 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onCloseMonitorWindowCu = function () {
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
// onEndUploadCu 나 onCloseMonitorWindowCu 이벤트 시점에 처리하시면 되며,
|
||||||
|
// onCloseMonitorWindowCu 시에는 getUploadStatus()를 호출하여 업로드 완료되어 있는지 체크해 주십시오.
|
||||||
|
if (uploader.getUploadStatus() == 'COMPLETION') {
|
||||||
|
|
||||||
|
// 업로드된 전체 파일의 정보를 가져옵니다.
|
||||||
|
var uploadedFilesInfo = uploader.<b>getUploadedFilesInfo</b>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 필요 시, 아래처럼 사용해 주십시오. (JSON으로 넘오올 경우)
|
||||||
|
var obj = jQuery.parseJSON(uploadedFilesInfo);
|
||||||
|
alertTimeout(obj.length);
|
||||||
|
alertTimeout(obj[0].name);
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>setAllowedFileExtension</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>setAllowedFileExtension</h2>
|
||||||
|
<p class="dscrpt">파일 추가시 허용할 파일 확장자를 설정합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">setAllowedFileExtension</span> ( String <span class="paraname">fileExtensions</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">fileExtensions</span></p>
|
||||||
|
<p class="paradsc">[in] 파일 추가시 허용할 파일 확장자입니다. 파일 확장자를 세미콜론(;) 문자로 연결해서 입력해 주십시오.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* 허용하지 않을 파일 확장자 설정
|
||||||
|
* setFileFilter로 설정한 것과는 별개로, 실제 업로드 할 수 있는 확장자는 아래와 같이 제한됩니다.
|
||||||
|
*/
|
||||||
|
uploader.<b>setAllowedFileExtension('exe;cgi;sql', 'REVERSE')</b>;
|
||||||
|
// 허용할 파일 확장자 기준으로 File Extension을 설정하려면 setAllowedFileExtension 메소드의 두번째 파라미터에 'FORWARD'를 입력해 주십시오.
|
||||||
|
//uploader.setAllowedFileExtension('jpg;jpeg;txt', 'FORWARD');
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>setFileFilter</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>setFileFilter</h2>
|
||||||
|
<p class="dscrpt">파일 추가 대화상자의 파일 필터를 설정합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">setFileFilter</span> ( Object Array <span class="paraname">fileFilter</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">fileFilter</span></p>
|
||||||
|
<p class="paradsc">[in] 파일 추가 대화상자에 설정될 파일 필터 입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* 파일 필터 설정
|
||||||
|
* 명시적 파일 확장자(.gif, .jpg, .png, .doc) 또는 아래와 같은 타입들을 콤마(,)로 연결하여 입력해 주십시오.
|
||||||
|
* - 'audio/*'
|
||||||
|
* - 'video/*'
|
||||||
|
* - 'image/*'
|
||||||
|
* - 'media_type'
|
||||||
|
*/
|
||||||
|
uploader.<b>setFileFilter('.txt,.jpg,.jpeg')</b>;
|
||||||
|
//uploader.setFileFilter('.txt,video/*');
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>setMaxFileCount</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>setMaxFileCount</h2>
|
||||||
|
<p class="dscrpt">파일 추가시 허용할 최대 파일개수를 설정합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">setMaxFileCount</span> ( Number <span class="paraname">maxFileCount</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">maxFileCount</span></p>
|
||||||
|
<p class="paradsc">[in] 파일 추가시 허용할 최대 파일개수입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
/* 파일 크기, 개수 제한
|
||||||
|
*/
|
||||||
|
uploader.<b>setMaxFileCount(5)</b>; // 파일 개수 제한
|
||||||
|
uploader.setMaxFileSize(1024 * 1024 * 5); // 개별 파일 크기를 5MB로 제한
|
||||||
|
uploader.setMaxTotalFileSize(1024 * 1024 * 10); // 전체 파일 크기를 10MB로 제한
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>setMaxFileSize</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>setMaxFileSize</h2>
|
||||||
|
<p class="dscrpt">파일 추가시 허용할 개별 파일의 최대 크기를 설정합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">setMaxFileSize</span> ( Number <span class="paraname">maxFileSize</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">maxFileSize</span></p>
|
||||||
|
<p class="paradsc">[in] 파일 추가시 허용할 개별 파일의 최대 크기입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
/* 파일 크기, 개수 제한
|
||||||
|
*/
|
||||||
|
uploader.setMaxFileCount(5); // 파일 개수 제한
|
||||||
|
uploader.<b>setMaxFileSize(1024 * 1024 * 5)</b>; // 개별 파일 크기를 5MB로 제한
|
||||||
|
uploader.setMaxTotalFileSize(1024 * 1024 * 10); // 전체 파일 크기를 10MB로 제한
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>setMaxTotalFileSize</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>setMaxTotalFileSize</h2>
|
||||||
|
<p class="dscrpt">파일 추가시 허용할 전체 파일의 최대 크기를 설정합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">setMaxTotalFileSize</span> ( Number <span class="paraname">maxTotalFileSize</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">maxTotalFileSize</span></p>
|
||||||
|
<p class="paradsc">[in] 파일 추가시 허용할 전체 파일의 최대 크기입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
/* 파일 크기, 개수 제한
|
||||||
|
*/
|
||||||
|
uploader.setMaxFileCount(5); // 파일 개수 제한
|
||||||
|
uploader.setMaxFileSize(1024 * 1024 * 5); // 개별 파일 크기를 5MB로 제한
|
||||||
|
uploader.<b>setMaxTotalFileSize(1024 * 1024 * 10)</b>; // 전체 파일 크기를 10MB로 제한
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>setUploadURL</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>setUploadURL</h2>
|
||||||
|
<p class="dscrpt">파일 업로드 URL을 설정합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">setUploadURL</span> ( String <span class="paraname">uploadURL</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">uploadURL</span></p>
|
||||||
|
<p class="paradsc">[in] 파일 업로드 URL입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* NamoCrossUploader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
<b>var uploadUrl = 'UploadProcess.jsp';</b>
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = '436'; // FileUploadManager 너비
|
||||||
|
managerProperties.height = '280'; // FileUploadManager 높이
|
||||||
|
managerProperties.containerId = 'uploaderContainer';// FileUploadManager 객체가 생성될 html div 태그 id
|
||||||
|
managerProperties.uploadButtonDisplayStyle = "none"
|
||||||
|
managerProperties.uploadUrl = uploadUrl; // 파일 업로드 처리 페이지 경로
|
||||||
|
|
||||||
|
var monitorProperties = new Object();
|
||||||
|
monitorProperties.monitorLayerClass = 'monitorLayer'; // FileUploadMonitor 창의 스타일입니다. (namocrossuploader.css 파일에 정의, 변경 가능)
|
||||||
|
monitorProperties.monitorBgLayerClass = 'monitorBgLayer'; // FileUploadMonitor 창의 백그라운드 스타일입니다. (namocrossuploader.css 파일에 정의, 변경 가능)
|
||||||
|
monitorProperties.closeMonitorCheckBoxChecked = true; // 전송 완료 후 FileUploadMonitor 창 닫기 설정
|
||||||
|
|
||||||
|
var uploader = namoCrossUploader.createUploader(
|
||||||
|
JSON.stringify(managerProperties), // FileUploadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(monitorProperties), // FileUploadMonitor 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(window.namoCrossUploaderConfig.eventNames)); // 이벤트 이름을 JSON 문자열로 전달
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>setUIProperties</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>setUploaderProperties</h2>
|
||||||
|
<p class="dscrpt">BasicFileUploadManager 객체와 BasicFileUploadMonitor 객체의 UI 속성을 설정합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">setUploaderProperties</span> ( Object <span class="paraname">uiProperties</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">fileFilter</span></p>
|
||||||
|
<p class="paradsc">[in] BasicFileUploadManager 객체와 BasicFileUploadMonitor 객체의 UI 속성입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* UI Properties 변경
|
||||||
|
*/
|
||||||
|
var resetUiProperties = function () {
|
||||||
|
var mainWidth = document.getElementById('mainWidth').value;
|
||||||
|
var mainHeight = document.getElementById('mainHeight').value;
|
||||||
|
var mainBorderColor = document.getElementById('mainBorderColor').value;
|
||||||
|
var topPanelDisplayStyle = (document.getElementsByName('topPanelDisplayStyle')[0].checked == true) ? 'block' : 'none';
|
||||||
|
var selectFilesButtonDisplayStyle = (document.getElementsByName('selectFilesButtonDisplayStyle')[0].checked == true) ? 'block' : 'none';
|
||||||
|
var selectFilesButtonDisabledStyle = (document.getElementsByName('selectFilesButtonDisabledStyle')[0].checked == true) ? true : false;
|
||||||
|
var uploadButtonDisplayStyle = (document.getElementsByName('uploadButtonDisplayStyle')[0].checked == true) ? 'block' : 'none';
|
||||||
|
var uploadButtonDisabledStyle = (document.getElementsByName('uploadButtonDisabledStyle')[0].checked == true) ? true : false;
|
||||||
|
var closeMonitorCheckBoxChecked = (document.getElementsByName('closeMonitorCheckBoxChecked')[0].checked == true) ? true : false;
|
||||||
|
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = mainWidth; // FileUploadManager 너비
|
||||||
|
managerProperties.height = mainHeight; // FileUploadManager 높이
|
||||||
|
managerProperties.borderColor = mainBorderColor; // FileUploadManager 보더 컬러
|
||||||
|
managerProperties.topPanelDisplayStyle = topPanelDisplayStyle; // 상단 패널 Visible 상태
|
||||||
|
managerProperties.selectFilesButtonDisplayStyle = selectFilesButtonDisplayStyle; // 파일선택 버튼 Visible 상태
|
||||||
|
managerProperties.selectFilesButtonDisabledStyle = selectFilesButtonDisabledStyle; // 파일선택 버튼 Enabled 상태
|
||||||
|
managerProperties.uploadButtonDisplayStyle = uploadButtonDisplayStyle; // 업로드 버튼 Visible 상태
|
||||||
|
managerProperties.uploadButtonDisabledStyle = uploadButtonDisabledStyle; // 업로드 버튼 Enabled 상태
|
||||||
|
|
||||||
|
|
||||||
|
var monitorProperties = new Object();
|
||||||
|
monitorProperties.closeMonitorCheckBoxChecked = closeMonitorCheckBoxChecked; // 전송 완료 후 FileUploadMonitor 창 닫기 설정
|
||||||
|
|
||||||
|
namoCrossUploader.<b>setUploaderProperties</b>(
|
||||||
|
JSON.stringify(managerProperties), // FileUploadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(monitorProperties)); // FileUploadMonitor 프로퍼티를 JSON 문자열로 전달
|
||||||
|
|
||||||
|
|
||||||
|
// 상단 패널, 또는 버튼의 visible, enabled 상태에 따라 html 버튼의 visibility 설정
|
||||||
|
document.getElementById("selectFiles").style.visibility = 'hidden';
|
||||||
|
document.getElementById("startUpload").style.visibility = 'hidden';
|
||||||
|
|
||||||
|
if (topPanelDisplayStyle == 'none') {
|
||||||
|
document.getElementById("selectFiles").style.visibility = 'visible';
|
||||||
|
document.getElementById("startUpload").style.visibility = 'visible';
|
||||||
|
}
|
||||||
|
else if (selectFilesButtonDisplayStyle == 'none' || selectFilesButtonDisabledStyle == true)
|
||||||
|
document.getElementById("selectFiles").style.visibility = 'visible';
|
||||||
|
else if (uploadButtonDisplayStyle == 'none' || uploadButtonDisabledStyle == true)
|
||||||
|
document.getElementById("startUpload").style.visibility = 'visible';
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>startUpload</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">BasicFileUploadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>startUpload</h2>
|
||||||
|
<p class="dscrpt">파일 업로드를 시작합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">startUpload</span> ( )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname"></span></p>
|
||||||
|
<p class="paradsc"></p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* 업로드 시작 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onStartUploadCu = function () {
|
||||||
|
//alert('업로드가 시작됐습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 사용자 정의 업로드
|
||||||
|
*/
|
||||||
|
var onStartUpload = function () {
|
||||||
|
//alert('업로드가 시적되었습니다.');
|
||||||
|
uploader.startUpload();
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>onException</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">MultipleFileDownloadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Events</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>onException</h2>
|
||||||
|
<p class="dscrpt">예외 발생 시 호출됩니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">onException</span> ( String <span class="paraname">params</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">params</span></p>
|
||||||
|
<p class="paradsc">[out] 예외정보로 JSON 타입의 String입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
<b>[namocrossuploader.js]</b>
|
||||||
|
/**
|
||||||
|
* NamoCrossDownloader 객체에서 Javascript로 전송할 이벤트 함수 이름을 설정합니다.
|
||||||
|
*/
|
||||||
|
var getDownloadManagerEventNames = function () {
|
||||||
|
var flashvars = {};
|
||||||
|
flashvars.onCreationComplete = "onCreationCompleteCd"; // NamoCrossDownloader Manager 객체 생성 완료 시
|
||||||
|
flashvars.onStartDownloadItem = "onStartDownloadItemCd"; // 개별 파일의 다운로드 시작 시 (Single Download Only)
|
||||||
|
flashvars.onEndDownloadItem = "onEndDownloadItemCd"; // 개별 파일의 다운로드 완료 시 (Single Download Only)
|
||||||
|
flashvars.onCancelDownloadItem = "onCancelDownloadItemCd"; // 개별 파일의 다운로드 취소 시 (Single Download Only)
|
||||||
|
<b>flashvars.onException = "onExceptionCd"; // 예외 발생 시</b>
|
||||||
|
return flashvars;
|
||||||
|
}
|
||||||
|
|
||||||
|
<b>[DownloadForm.html]</b>
|
||||||
|
/**
|
||||||
|
* 예외 발생 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onExceptionCd = function (params) {
|
||||||
|
// 300~ : 일반적 예외
|
||||||
|
// 400~ : 시스템 예외
|
||||||
|
// 500~ : 서측에서 발생한 예외
|
||||||
|
// 필요한 예외정보만 고객에서 보여주십시오.
|
||||||
|
var obj = jQuery.parseJSON(params);
|
||||||
|
alertTimeout("[예외 정보]\n" + "code : " + obj.code + "\n" + "message : " + obj.message + "\n" + "detailMessage : " + obj.detailMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash로부터 호출되는 Javascript 콜백함수 내에서 alert 창을 띄우기 위한 처리로 Chrome, Firefox, Safari 브라우저의 일부 버전에 해당됩니다.
|
||||||
|
*/
|
||||||
|
var alertTimeout = function (params) {
|
||||||
|
window.focus();
|
||||||
|
setTimeout(function () { alert(params) }, 100);
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>addFile</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">SingleFileDownloadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>addFile</h2>
|
||||||
|
<p class="dscrpt">다운로드 할 파일을 추가합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">addFile</span> ( Object <span class="paraname">fileInfo</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">fileInfo</span></p>
|
||||||
|
<p class="paradsc">[in] 다운로드 할 파일정보입니다. 파일정보는 fileId, fileName, fileURL, fileSize 입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
var fileIdArray = new Array('FILEID_0001', 'FILEID_0002', 'FILEID_0003');
|
||||||
|
var fileNameArray = new Array('나모크로스에디터3_제품소개서.pdf', 'ActiveSquare 7_brochure.pdf', '130617_나모_펍트리_브로셔_130702.pdf');
|
||||||
|
var fileSizeArray = new Array('2210715', '2816868', '2717166');
|
||||||
|
|
||||||
|
for (var i = 0; i < fileIdArray.length; i++) {
|
||||||
|
var fileInfo = new Object();
|
||||||
|
fileInfo.fileId = fileIdArray[i];
|
||||||
|
fileInfo.fileName = fileNameArray[i];
|
||||||
|
fileInfo.fileSize = fileSizeArray[i];
|
||||||
|
fileInfo.fileUrl = downloadUrl; // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다.
|
||||||
|
|
||||||
|
<b>downloader.addFile(JSON.stringify(fileInfo));</b>
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>setUIProperties</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">MultipleFileDownloadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>setUIProperties</h2>
|
||||||
|
<p class="dscrpt">MultipleFileDownloadManager와 MultipleFileDownloadMonitor AIR 객체의 UI 속성을 설정합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">setUIProperties</span> ( Object <span class="paraname">uiProperties</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">fileFilter</span></p>
|
||||||
|
<p class="paradsc">[in] MultipleFileDownloadManager와 MultipleFileDownloadMonitor AIR 객체의 UI 속성입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* UI Properties 변경
|
||||||
|
*/
|
||||||
|
var resetUiProperties = function () {
|
||||||
|
var mainWidth = document.getElementById('mainWidth').value;
|
||||||
|
var mainHeight = document.getElementById('mainHeight').value;
|
||||||
|
var mainBorderColor = document.getElementById('mainBorderColor').value;
|
||||||
|
var bottomPanelDisplayStyle = (document.getElementsByName('bottomPanelDisplayStyle')[0].checked == true) ? 'block' : 'none';
|
||||||
|
var downloadButtonDisplayStyle = (document.getElementsByName('downloadButtonDisplayStyle')[0].checked == true) ? 'block' : 'none';
|
||||||
|
var downloadButtonDisabledStyle = (document.getElementsByName('downloadButtonDisabledStyle')[0].checked == true) ? true : false;
|
||||||
|
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.uiMode = 'MULTIPLE'; // FileDownloadManager UI 모드 설정
|
||||||
|
managerProperties.width = mainWidth; // FileDownloadManager 너비
|
||||||
|
managerProperties.height = mainHeight; // FileDownloadManager 높이
|
||||||
|
managerProperties.borderColor = mainBorderColor; // FileDownloadManager 보더 컬러
|
||||||
|
managerProperties.bottomPanelDisplayStyle = bottomPanelDisplayStyle; // 하단 패널 Visible 상태
|
||||||
|
managerProperties.downloadButtonDisplayStyle = downloadButtonDisplayStyle; // 다운로드 버튼 Visible 상태
|
||||||
|
managerProperties.downloadButtonDisabledStyle = downloadButtonDisabledStyle; // 다운로드 버튼 Enabled 상태
|
||||||
|
|
||||||
|
namoCrossUploader.setDownloaderProperties(
|
||||||
|
JSON.stringify(managerProperties)); // FileDownloadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
|
||||||
|
|
||||||
|
// 하단 패널, 또는 버튼의 visible, enabled 상태에 따라 html 버튼의 visibility 설정
|
||||||
|
document.getElementById("startDownload").style.visibility = "hidden";
|
||||||
|
|
||||||
|
if (bottomPanelDisplayStyle == 'none')
|
||||||
|
document.getElementById("startDownload").style.visibility = "visible";
|
||||||
|
else if (downloadButtonDisplayStyle == 'none' || downloadButtonDisabledStyle == true)
|
||||||
|
document.getElementById("startDownload").style.visibility = "visible";
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>addFile</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">SingleFileDownloadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>addFile</h2>
|
||||||
|
<p class="dscrpt">다운로드 할 파일을 추가합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">addFile</span> ( Object <span class="paraname">fileInfo</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">fileInfo</span></p>
|
||||||
|
<p class="paradsc">[in] 다운로드 할 파일정보입니다. 파일정보는 fileId, fileName, fileURL, fileSize 입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
var fileIdArray = new Array('FILEID_0001', 'FILEID_0002', 'FILEID_0003');
|
||||||
|
var fileNameArray = new Array('나모크로스에디터3_제품소개서.pdf', 'ActiveSquare 7_brochure.pdf', '130617_나모_펍트리_브로셔_130702.pdf');
|
||||||
|
var fileSizeArray = new Array('2210715', '2816868', '2717166');
|
||||||
|
|
||||||
|
for (var i = 0; i < fileIdArray.length; i++) {
|
||||||
|
var fileInfo = new Object();
|
||||||
|
fileInfo.fileId = fileIdArray[i];
|
||||||
|
fileInfo.fileName = fileNameArray[i];
|
||||||
|
fileInfo.fileSize = fileSizeArray[i];
|
||||||
|
fileInfo.fileUrl = downloadUrl; // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다.
|
||||||
|
|
||||||
|
<b>downloader.addFile(JSON.stringify(fileInfo));</b>
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>setUIProperties</title>
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link rel="stylesheet" href="../../../images/linkstyle.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" bgcolor="#EEEEEE" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme">SingleFileDownloadManager</p>
|
||||||
|
</td>
|
||||||
|
<td width="10%" bgcolor="#5A7FC1" bordercolor="#999999">
|
||||||
|
<p align="center" class="pme"><font color="white">Methods</font></p>
|
||||||
|
</td>
|
||||||
|
<td width="10%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<p align="center" class="pme"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="0" width="640">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2>setUIProperties</h2>
|
||||||
|
<p class="dscrpt">SingleFileDownloadManager 객체의 UI 속성을 설정합니다.</p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Syntax</h4>
|
||||||
|
<ul>
|
||||||
|
<pre>void <span class="fname">setUIProperties</span> ( Object <span class="paraname">uiProperties</span> )</pre>
|
||||||
|
</ul>
|
||||||
|
<h4>Parameters</h4>
|
||||||
|
<p class="para"><span class="paraname">fileFilter</span></p>
|
||||||
|
<p class="paradsc">[in] SingleFileDownloadManager 객체의 UI 속성입니다.</p>
|
||||||
|
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Return Values</h4>
|
||||||
|
<p class="dscrpt"></p>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<P class="dscrpt"></P>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
<h4>Sample Codes</h4>
|
||||||
|
<p class="scode">Javascript</p>
|
||||||
|
<pre class="scodedsc">
|
||||||
|
/**
|
||||||
|
* UI Properties 변경
|
||||||
|
*/
|
||||||
|
var resetUiProperties = function () {
|
||||||
|
var mainWidth = document.getElementById('mainWidth').value;
|
||||||
|
var mainHeight = document.getElementById('mainHeight').value;
|
||||||
|
var mainBorderColor = document.getElementById('mainBorderColor').value;
|
||||||
|
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.uiMode = 'SINGLE'; // FileDownloadManager UI 모드 설정
|
||||||
|
managerProperties.width = mainWidth; // FileDownloadManager 너비
|
||||||
|
managerProperties.height = mainHeight; // FileDownloadManager 높이
|
||||||
|
managerProperties.borderColor = mainBorderColor; // FileDownloadManager 보더 컬러
|
||||||
|
|
||||||
|
namoCrossUploader.setDownloaderProperties(
|
||||||
|
JSON.stringify(managerProperties)); // FileDownloadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<p class="dscrpt"> </p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link href="../common.css" rel="stylesheet" type="text/css" />
|
||||||
|
<title>Namo CrossUploader Client Flex Edition Manual</title>
|
||||||
|
<base target="right">
|
||||||
|
</head>
|
||||||
|
<script type="text/javascript" src="../popup.js"></script>
|
||||||
|
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll="no">
|
||||||
|
<table border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed; width:100%; height:100%;">
|
||||||
|
<tr>
|
||||||
|
<td style="width:250;">
|
||||||
|
<div style="padding:10; height:100%; overflow:auto;">
|
||||||
|
<!-- Tree ----------------------------------->
|
||||||
|
<p class="cu_obj_guide"><img src="../images/icon_list_01.png" style="vertical-align:middle" border="0">API 안내</p>
|
||||||
|
|
||||||
|
<!-- BasicFileUploadManager -->
|
||||||
|
<p class=cu_obj><img src="../images/icon_list_02.png" style="vertical-align:middle" border="0"><a onclick="doExpand(BasicFileUploadManager_Object)" href="api/BasicFileUploadManager/Methods/addUploadedFile.html">BasicFileUploadManager</a></p>
|
||||||
|
<div id="BasicFileUploadManager_Object" style="display:block;">
|
||||||
|
<!-- Methods -->
|
||||||
|
<p class="cu_obj_api"><img src="../images/icon_list_02.png" style="vertical-align:middle" border="0"><a onclick="doExpand(BasicFileUploadManager_Methods)" href="api/BasicFileUploadManager/Methods/addUploadedFile.html">Methods</a></p>
|
||||||
|
<div id="BasicFileUploadManager_Methods" style="display:none;">
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/addUploadedFile.html">addUploadedFile</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/getModifiedFilesInfo.html">getModifiedFilesInfo</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/getTotalFileCount.html">getTotalFileCount</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/getUploadedFilesInfo.html">getUploadedFilesInfo</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/getUploadStatus.html">getUploadStatus</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/setAllowedFileExtension.html">setAllowedFileExtension</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/setFileFilter.html">setFileFilter</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/setMaxFileCount.html">setMaxFileCount</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/setMaxFileSize.html">setMaxFileSize</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/setMaxTotalFileSize.html">setMaxTotalFileSize</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/setUploaderProperties.html">setUploaderProperties</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/setUploadURL.html">setUploadURL</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Methods/startUpload.html">startUpload</a></p>
|
||||||
|
</div>
|
||||||
|
<!-- Events -->
|
||||||
|
<p class="cu_obj_api"><img src="../images/icon_list_02.png" style="vertical-align:middle" border="0"><a onclick="doExpand(BasicFileUploadManager_Events)" href="api/BasicFileUploadManager/Events/onCancelUploadItem.html">Events</a></p>
|
||||||
|
<div id="BasicFileUploadManager_Events" style="display:none;">
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Events/onCancelUploadItem.html">onCancelUploadItem</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Events/onCloseMonitorWindow.html">onCloseMonitorWindow</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Events/onEndUploadItem.html">onEndUploadItem</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Events/onEndUpload.html">onEndUpload</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Events/onException.html">onException</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Events/onStartUpload.html">onStartUpload</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/BasicFileUploadManager/Events/onStartUploadItem.html">onStartUploadItem</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- SingleFileDownloadManager -->
|
||||||
|
<p class=cu_obj><img src="../images/icon_list_02.png" style="vertical-align:middle" border="0"><a onclick="doExpand(SingleFileDownloadManager_Object)" href="api/SingleFileDownloadManager/Methods/addFile.html">SingleFileDownloadManager</a></p>
|
||||||
|
<div id="SingleFileDownloadManager_Object" style="display:block;">
|
||||||
|
<!-- Methods -->
|
||||||
|
<p class="cu_obj_api"><img src="../images/icon_list_02.png" style="vertical-align:middle" border="0"><a onclick="doExpand(SingleFileDownloadManager_Methods)" href="api/SingleFileDownloadManager/Methods/addFile.html">Methods</a></p>
|
||||||
|
<div id="SingleFileDownloadManager_Methods" style="display:none;">
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/SingleFileDownloadManager/Methods/addFile.html">addFile</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/SingleFileDownloadManager/Methods/setDownloaderProperties.html">setDownloaderProperties</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- MultipleFileDownloadManager -->
|
||||||
|
<p class=cu_obj><img src="../images/icon_list_02.png" style="vertical-align:middle" border="0"><a onclick="doExpand(MultipleFileDownloadManager_Object)" href="api/MultipleFileDownloadManager/Methods/addFile.html">MultipleFileDownloadManager</a></p>
|
||||||
|
<div id="MultipleFileDownloadManager_Object" style="display:block;">
|
||||||
|
<!-- Methods -->
|
||||||
|
<p class="cu_obj_api"><img src="../images/icon_list_02.png" style="vertical-align:middle" border="0"><a onclick="doExpand(MultipleFileDownloadManager_Methods)" href="api/MultipleFileDownloadManager/Methods/addFile.html">Methods</a></p>
|
||||||
|
<div id="MultipleFileDownloadManager_Methods" style="display:none;">
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/MultipleFileDownloadManager/Methods/addFile.html">addFile</a></p>
|
||||||
|
<p class="cu_obj_api_name"><img src="../images/icon_list_03.png" style="vertical-align:middle" border="0"><a href="api/MultipleFileDownloadManager/Methods/setUIProperties.html">setUIProperties</a></p>
|
||||||
|
</div>
|
||||||
|
<!-- Tree ----------------------------------->
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="width:1px;" bgcolor="#C2CDD4"></td>
|
||||||
|
|
||||||
|
<!-- API Descriptoin -->
|
||||||
|
<td style="width:100%;">
|
||||||
|
<iframe name="right" src="api/BasicFileUploadManager/Methods/addUploadedFile.html" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link href="../common.css" rel="stylesheet" type="text/css" />
|
||||||
|
<title>Namo CrossUploader Client Html5 Edition Manual</title>
|
||||||
|
<base target="right">
|
||||||
|
</head>
|
||||||
|
<script language="javascript" src="../popup.js"></script>
|
||||||
|
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll="no">
|
||||||
|
<table border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed; width:100%; height:100%;">
|
||||||
|
<tr>
|
||||||
|
<td style="width:250;">
|
||||||
|
|
||||||
|
<div style="padding:10; height:100%; overflow:auto;">
|
||||||
|
<!-- Tree ----------------------------------->
|
||||||
|
<p class="ctbic"><img src="../images/icon_list_01.png" style="vertical-align:middle" border="0"><a href="intro.html">소개</a></p>
|
||||||
|
<!-- Tree ----------------------------------->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td style="width:1px;" bgcolor="#C2CDD4"></td>
|
||||||
|
<td style="width:100%;">
|
||||||
|
<iframe name="right" src="intro.html" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
P {
|
||||||
|
FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²,serif
|
||||||
|
}
|
||||||
|
LI {
|
||||||
|
FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²,serif
|
||||||
|
}
|
||||||
|
PRE {
|
||||||
|
PADDING-RIGHT: 5pt; MARGIN-TOP: 0px; PADDING-LEFT: 5pt; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 5pt; MARGIN-LEFT: 0px; PADDING-TOP: 5pt; FONT-FAMILY: 'courier new',courier,serif,±¼¸²; BACKGROUND-COLOR: rgb(238,238,238)
|
||||||
|
}
|
||||||
|
DD {
|
||||||
|
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 25px; LINE-HEIGHT: 150%; FONT-FAMILY: ±¼¸²,serif
|
||||||
|
}
|
||||||
|
.dscrpt {
|
||||||
|
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 25px; LINE-HEIGHT: 150%; FONT-FAMILY: ±¼¸²,sans-serif;
|
||||||
|
}
|
||||||
|
.para {
|
||||||
|
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 25px; COLOR: blue; LINE-HEIGHT: 150%; FONT-STYLE: italic; FONT-FAMILY: 'courier new',sans-serif
|
||||||
|
}
|
||||||
|
.paradsc {
|
||||||
|
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-BOTTOM: 5px; MARGIN-LEFT: 75px; LINE-HEIGHT: 150%; FONT-FAMILY: ±¼¸²,sans-serif
|
||||||
|
}
|
||||||
|
.paradsc2 {
|
||||||
|
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 75px; LINE-HEIGHT: 120%; FONT-FAMILY: ±¼¸²,sans-serif;
|
||||||
|
}
|
||||||
|
.paraname {
|
||||||
|
COLOR: blue; FONT-STYLE: italic; FONT-FAMILY: 'courier new',sans-serif
|
||||||
|
}
|
||||||
|
.fname {
|
||||||
|
FONT-WEIGHT: bold; COLOR: blue
|
||||||
|
}
|
||||||
|
.scode {
|
||||||
|
MARGIN-TOP: 0px; FONT-SIZE: 9pt; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 35px; COLOR: blue; LINE-HEIGHT: 150%; FONT-FAMILY: ±¼¸²,serif
|
||||||
|
}
|
||||||
|
.scodedsc {
|
||||||
|
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 35px; LINE-HEIGHT: 150%
|
||||||
|
}
|
||||||
|
.scodecmt {
|
||||||
|
FONT-SIZE: 9pt; COLOR: rgb(51,153,0); FONT-FAMILY: ±¼¸²
|
||||||
|
}
|
||||||
|
H1 {
|
||||||
|
FONT-SIZE: 16pt; MARGIN-BOTTOM: 30px; COLOR: rgb(72,82,133); FONT-FAMILY: ±¼¸², Verdana
|
||||||
|
}
|
||||||
|
H2 {
|
||||||
|
MARGIN-TOP: 5px; FONT-SIZE: 12pt; MARGIN-BOTTOM: 10px; FONT-FAMILY: Verdana
|
||||||
|
}
|
||||||
|
H3 {
|
||||||
|
MARGIN-TOP: 40pt; FONT-SIZE: 12pt; MARGIN-LEFT: 30pt; COLOR: rgb(70,115,160); FONT-FAMILY: ±¼¸²
|
||||||
|
}
|
||||||
|
H4 {
|
||||||
|
MARGIN-TOP: 5px; FONT-SIZE: 11pt; MARGIN-BOTTOM: 10px; COLOR: rgb(51,51,153); FONT-FAMILY: Verdana,serif
|
||||||
|
}
|
||||||
|
H5 {
|
||||||
|
FONT-SIZE: 10pt; MARGIN-LEFT: 30pt; COLOR: #000066; FONT-FAMILY: µ¸¿ò
|
||||||
|
}
|
||||||
|
H2 SUB {
|
||||||
|
FONT-SIZE: 10pt; MARGIN-LEFT: 25px; COLOR: #999999; FONT-FAMILY: Verdana
|
||||||
|
}
|
||||||
|
.mtext {
|
||||||
|
MARGIN-TOP: 0pt; FONT-SIZE: 9pt; MARGIN-BOTTOM: 5pt; MARGIN-LEFT: 30pt; LINE-HEIGHT: 150%; FONT-FAMILY: ±¼¸²
|
||||||
|
}
|
||||||
|
.ini_title {
|
||||||
|
FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN-LEFT: 30pt
|
||||||
|
}
|
||||||
|
.ini_syntax {
|
||||||
|
FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0pt; MARGIN-LEFT: 30pt; COLOR: rgb(72,82,133)
|
||||||
|
}
|
||||||
|
.ini_text {
|
||||||
|
MARGIN-TOP: 0pt; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0pt; MARGIN-LEFT: 50pt; LINE-HEIGHT: 150%
|
||||||
|
}
|
||||||
|
.ini_example {
|
||||||
|
FONT-SIZE: 10pt; COLOR: #000066
|
||||||
|
}
|
||||||
|
.ini_italic {
|
||||||
|
FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: italic
|
||||||
|
}
|
||||||
|
.ctbic {
|
||||||
|
FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: ±¼¸²,serif
|
||||||
|
}
|
||||||
|
.ctmid {
|
||||||
|
MARGIN-TOP: 15pt; FONT-WEIGHT: bold; FONT-SIZE: 9pt; MARGIN-BOTTOM: 3pt; COLOR: rgb(72,82,133); FONT-FAMILY: ±¼¸²,serif
|
||||||
|
}
|
||||||
|
.ctsmall {
|
||||||
|
MARGIN-TOP: 0pt; FONT-SIZE: 9pt; MARGIN-BOTTOM: 3pt; MARGIN-LEFT: 11pt; FONT-FAMILY: µ¸¿ò
|
||||||
|
}
|
||||||
|
.pme {
|
||||||
|
FONT-SIZE: 8pt; COLOR: #999999; FONT-FAMILY: Verdana
|
||||||
|
}
|
||||||
|
.menu {
|
||||||
|
FONT-SIZE: 9pt; COLOR: rgb(0,102,153); FONT-FAMILY: µ¸¿ò
|
||||||
|
}
|
||||||
|
.order {
|
||||||
|
FONT-SIZE: 10pt; COLOR: rgb(153,153,153); FONT-FAMILY: 'Arial Black'
|
||||||
|
}
|
||||||
|
|
||||||
|
body{
|
||||||
|
scrollbar-3dlight-color:9B9B9B;
|
||||||
|
scrollbar-arrow-color:ffffff;
|
||||||
|
scrollbar-base-color:E2E2E2;
|
||||||
|
scrollbar-darkshadow-color:FFFFFF;
|
||||||
|
scrollbar-face-color:E2E2E2;
|
||||||
|
scrollbar-highlight-color:FFFFF;
|
||||||
|
scrollbar-shadow-color:9B9B9B}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link href="../common.css" rel="stylesheet" type="text/css" />
|
||||||
|
<title>Namo CrossUploader Client Html5 Edition Manual</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
<table style="line-height:120%; margin-right:20;" border="0" cellpadding="0" width="94%" align="center">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h1>소개</h1>
|
||||||
|
<H3>Namo CrossUploader Client Html5 Edition은</H3>
|
||||||
|
<P class="mtext">HTTP 프로토콜 기반의 Client-Side 업로드 컴포넌트로입니다.</P>
|
||||||
|
<P class="mtext">이 제품은 Html5기반의 제품으로서 Html5가 지원되는 브라우저 환경을 지원합니다.</P>
|
||||||
|
|
||||||
|
<h3>이 안내서는</h3>
|
||||||
|
<p class="mtext">개발자 안내서에서는 Namo CrossUploader Client Html5 Edition의 기능과
|
||||||
|
프로그램 제어를 위한 API(Application Programming Interface)에 대하여 안내합니다.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link href="common.css" rel="stylesheet" type="text/css" />
|
||||||
|
<title>Namo CrossUploader Client Flex Edition Manual</title>
|
||||||
|
<base target="body">
|
||||||
|
</head>
|
||||||
|
<body id="head_title" style="overflow:hidden;">
|
||||||
|
|
||||||
|
<table width="100%" height="50" background="images/table_navi_bg.png" border="0" cellspacing="0" cellpadding="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||||
|
<tr>
|
||||||
|
<td width="200" align="left"><img src="images/title_bi.png" border="0"></td>
|
||||||
|
<td>
|
||||||
|
<div align="center" style="width:450px; height:50px;">
|
||||||
|
<ul class="navi-tab clearfix">
|
||||||
|
<!--<li class=""><span><a href="index.html" target="_parent">사용자</a></span></li>-->
|
||||||
|
<li class="on"><span>개발자</span></li>
|
||||||
|
<!-- <li class=""><span><a href="install_index.html" target="_parent">설치안내</a></span></li>-->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td width="150" align="right"><a href="http://www.namo.co.kr" onFocus="this.blur()" target="_new"><img src="images/title_ci.png" border="0"></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table width="100%" height="37" background="images/table_sub_bg.png" border="0" cellspacing="0" cellpadding="0">
|
||||||
|
<tr>
|
||||||
|
<td align="center">
|
||||||
|
<table id="head_menu">
|
||||||
|
<tr>
|
||||||
|
<td> <a href="dev/body_intro.html"><b>소개</b></a> </td>
|
||||||
|
<td><img src="images/menu_line.png"></td>
|
||||||
|
<!--<td> <a href="dev/body_admin.html"><b>관리자 설정 안내</b></a> </td>
|
||||||
|
<td><img src="images/menu_line.png"></td>-->
|
||||||
|
<td> <a href="dev/body_api.html"><b>API(Html5) 안내</b></a> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<br />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link href="common.css" rel="stylesheet" type="text/css" />
|
||||||
|
<title>Namo CrossUploader Client Flex Edition Manual</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<frameset rows="80,*" border="0">
|
||||||
|
<frame name="hesd" marginwidth="0" marginheight="0" src="dev_header.html" scrolling="no" noresize>
|
||||||
|
<frame name="body" marginwidth="0" marginheight="0" src="dev/body_intro.html" scrolling="no" noresize>
|
||||||
|
</frameset><noframes></noframes>
|
||||||
|
</html>
|
||||||
|
After Width: | Height: | Size: 92 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 144 B |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 67 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 51 B |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 248 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 256 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 248 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 256 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 54 B |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 65 B |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 754 B |
|
After Width: | Height: | Size: 4.0 KiB |
|
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="author" content="Namo Interactive, Inc.">
|
||||||
|
<link href="common.css" rel="stylesheet" type="text/css" />
|
||||||
|
<title>Namo CrossUploader Client Flex Edition Manual</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<frameset rows="80,*" border="0">
|
||||||
|
<!--
|
||||||
|
<frame name="hesd" marginwidth="0" marginheight="0" src="user_header.htm" scrolling="no" noresize>
|
||||||
|
<frame name="body" marginwidth="0" marginheight="0" src="user/body_intro.htm" scrolling="no" noresize>
|
||||||
|
-->
|
||||||
|
<frame name="hesd" marginwidth="0" marginheight="0" src="dev_header.html" scrolling="no" noresize>
|
||||||
|
<frame name="body" marginwidth="0" marginheight="0" src="dev/body_intro.html" scrolling="no" noresize>
|
||||||
|
</frameset><noframes></noframes>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
/* expand and collapse
|
||||||
|
*/
|
||||||
|
function doExpand(paraNum){
|
||||||
|
if (paraNum.style.display=="none") {
|
||||||
|
paraNum.style.display="block";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
paraNum.style.display="none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
popfont="Facename[, point size[, charset[, PLAIN BOLD ITALIC UNDERLINE]]]"
|
||||||
|
Text1="The text for the first pop-up window."
|
||||||
|
Text2="The text for the second pop-up window."
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>Server-Side 연동 없이 웹상에 노출된 파일을 다운로드하는 예제입니다.</title>
|
||||||
|
|
||||||
|
<!-- 샘플 설명을 위한 화면 스타일입니다. 중요하지 않으며, 필요 없을 시 삭제해 주십시오. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
|
||||||
|
|
||||||
|
<!-- NamoCrossUploader Client HTML5 Edition 이 동작하기 위한 필수 파일입니다. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/slick.grid.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/smoothness/jquery-ui-1.8.16.custom.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/theme.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/css/namocrossuploader.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/contextmenu/jquery.contextMenu.css" />
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery-1.11.3.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery.event.drag-2.2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.grid.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.dataview.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.formatters.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.checkboxselectcolumn.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.rowselectionmodel.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader-config.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.contextMenu.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.ui.position.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="content_title_area">
|
||||||
|
<div class="content_title">샘플 설명</div>
|
||||||
|
<div class="content_desc">Server-Side 연동 없이 웹상에 노출된 파일을 다운로드하는 예제입니다. 파일 노출여부가 중요하지 않을 때 사용해 주십시오. (싱글 파일 다운로드에서만 사용)</div>
|
||||||
|
<div class="content_title">샘플 경로</div>
|
||||||
|
<div class="content_desc">Samples/Download/ExposedFileDownload</div>
|
||||||
|
</div><br />
|
||||||
|
|
||||||
|
<div id="downloaderContainer" class="form_area">
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
var addFiles = function ()
|
||||||
|
{
|
||||||
|
var fileIdArray = new Array('FILEID_0001', 'FILEID_0002', 'FILEID_0003');
|
||||||
|
var fileNameArray = new Array('나모크로스에디터3_제품소개서.pdf', 'ActiveSquare 7_brochure.pdf', '130617_나모_펍트리_브로셔_130702.pdf');
|
||||||
|
var fileSizeArray = new Array('2210715', '2816868', '2717166');
|
||||||
|
|
||||||
|
for (var i = 0; i < fileIdArray.length; i++) {
|
||||||
|
var fileInfo = new Object();
|
||||||
|
fileInfo.fileId = fileIdArray[i];
|
||||||
|
fileInfo.fileName = fileNameArray[i];
|
||||||
|
fileInfo.fileSize = fileSizeArray[i];
|
||||||
|
fileInfo.fileUrl = ''; // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다.
|
||||||
|
|
||||||
|
downloader.addFile(JSON.stringify(fileInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
downloader.scrollRow(0); // 첫번째 파일 위치로 스크롤 이동
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전체 파일 삭제
|
||||||
|
*/
|
||||||
|
var deleteAllFiles = function ()
|
||||||
|
{
|
||||||
|
downloader.deleteAllFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossDownloader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
var namoCrossUploader = new __NamoCrossUploader();
|
||||||
|
var downloadUrl = window.namoCrossUploaderConfig.productPath + 'Download/DownloadFiles/';
|
||||||
|
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = '436'; // FileDownloadManager 너비
|
||||||
|
managerProperties.height = '280'; // FileDownloadManager 높이
|
||||||
|
managerProperties.containerId = 'downloaderContainer'; // FileDownloadManager 객체가 생성될 html div 태그 id
|
||||||
|
managerProperties.uiMode = 'SINGLE'; // FileDownloadManager UI 모드 설정
|
||||||
|
//managerProperties.downloadUrl = downloadUrl; // 다운로드 처리 페이지
|
||||||
|
|
||||||
|
var downloader = namoCrossUploader.createDownloader(
|
||||||
|
JSON.stringify(managerProperties)); // FileDownloadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
addFiles();
|
||||||
|
</script>
|
||||||
|
<br />
|
||||||
|
<input type="button" value="파일 추가" onclick="addFiles()" />
|
||||||
|
<input type="button" value="전체 파일 삭제" onclick="deleteAllFiles()" />
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>파일 리스트 정렬 및 위치 이동 예제입니다.</title>
|
||||||
|
|
||||||
|
<!-- 샘플 설명을 위한 화면 스타일입니다. 중요하지 않으며, 필요 없을 시 삭제해 주십시오. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
|
||||||
|
|
||||||
|
<!-- NamoCrossUploader Client HTML5 Edition 이 동작하기 위한 필수 파일입니다. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/slick.grid.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/smoothness/jquery-ui-1.8.16.custom.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/theme.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/css/namocrossuploader.css" />
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery-1.11.3.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery.event.drag-2.2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.grid.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.dataview.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.checkboxselectcolumn.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.rowselectionmodel.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader-config.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.contextMenu.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.ui.position.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/contextmenu/jquery.contextMenu.css" />
|
||||||
|
<!-- -->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="content_title_area">
|
||||||
|
<div class="content_title">샘플 설명</div>
|
||||||
|
<div class="content_desc">파일 리스트 정렬 및 위치 이동 예제입니다. (싱글 파일 다운로드 동일)</div>
|
||||||
|
<div class="content_title">샘플 경로</div>
|
||||||
|
<div class="content_desc">Samples/Download/MoveFileLocation</div>
|
||||||
|
</div><br />
|
||||||
|
|
||||||
|
<div id="downloaderContainer" class="form_area">
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
var addFiles = function()
|
||||||
|
{
|
||||||
|
var fileIdArray = new Array('FILEID_0001', 'FILEID_0002', 'FILEID_0003');
|
||||||
|
var fileNameArray = new Array('나모크로스에디터3_제품소개서.pdf', 'ActiveSquare 7_brochure.pdf', '130617_나모_펍트리_브로셔_130702.pdf');
|
||||||
|
var fileSizeArray = new Array('2210715', '2816868', '2717166');
|
||||||
|
|
||||||
|
for (var i = 0; i < fileIdArray.length; i++) {
|
||||||
|
var fileInfo = new Object();
|
||||||
|
fileInfo.fileId = fileIdArray[i];
|
||||||
|
fileInfo.fileName = fileNameArray[i];
|
||||||
|
fileInfo.fileSize = fileSizeArray[i];
|
||||||
|
fileInfo.fileUrl = ''; // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다.
|
||||||
|
|
||||||
|
downloader.addFile(JSON.stringify(fileInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
downloader.scrollRow(0); // 첫번째 파일 위치로 스크롤 이동
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전체 파일 삭제
|
||||||
|
*/
|
||||||
|
var deleteAllFiles = function()
|
||||||
|
{
|
||||||
|
downloader.deleteAllFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossDownloader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
var namoCrossUploader = new __NamoCrossUploader();
|
||||||
|
var downloadUrl = window.namoCrossUploaderConfig.productPath + 'Download/MoveFileLocation/DownloadProcess.jsp';
|
||||||
|
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = '436'; // FileDownloadManager 너비
|
||||||
|
managerProperties.height = '280'; // FileDownloadManager 높이
|
||||||
|
managerProperties.containerId = 'downloaderContainer'; // FileDownloadManager 객체가 생성될 html div 태그 id
|
||||||
|
managerProperties.uiMode = 'MULTIPLE'; // FileDownloadManager UI 모드 설정
|
||||||
|
managerProperties.downloadUrl = downloadUrl; // 다운로드 처리 페이지
|
||||||
|
managerProperties.sortable = true; // 정렬을 활성화 합니다.
|
||||||
|
|
||||||
|
var downloader = namoCrossUploader.createDownloader(
|
||||||
|
JSON.stringify(managerProperties)); // FileDownloadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
addFiles();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 파일 위치 이동
|
||||||
|
*/
|
||||||
|
var moveFirstLocation = function ()
|
||||||
|
{
|
||||||
|
downloader.moveFirstLocation();
|
||||||
|
}
|
||||||
|
var movePrevLocation = function ()
|
||||||
|
{
|
||||||
|
downloader.movePrevLocation();
|
||||||
|
}
|
||||||
|
var moveNextLocation = function ()
|
||||||
|
{
|
||||||
|
downloader.moveNextLocation();
|
||||||
|
}
|
||||||
|
var moveLastLocation = function ()
|
||||||
|
{
|
||||||
|
downloader.moveLastLocation();
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<div>
|
||||||
|
<input type="button" value="파일 추가" onclick="addFiles()" />
|
||||||
|
<input type="button" value="전체 파일 삭제" onclick="deleteAllFiles()" />
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div>
|
||||||
|
<input type="button" value="맨 앞으로 이동" onclick="moveFirstLocation()" />
|
||||||
|
<input type="button" value="이전으로 이동" onclick="movePrevLocation()" />
|
||||||
|
<input type="button" value="다음으로 이동" onclick="moveNextLocation()" />
|
||||||
|
<input type="button" value="맨 뒤로 이동" onclick="moveLastLocation()" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8"%>
|
||||||
|
<%@page import="com.namo.crossuploader.*"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="java.net.URLEncoder"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
<%@page import="java.util.List"%>
|
||||||
|
<%@page import="java.util.ArrayList"%>
|
||||||
|
<%@page import="java.io.BufferedInputStream"%>
|
||||||
|
<%@page import="java.io.BufferedOutputStream"%>
|
||||||
|
<%@page import="java.io.File"%>
|
||||||
|
<%@page import="java.io.FileInputStream"%>
|
||||||
|
<%@page import="java.io.FileOutputStream"%>
|
||||||
|
<%@page import="java.util.zip.ZipEntry"%>
|
||||||
|
<%@page import="java.util.zip.ZipInputStream"%>
|
||||||
|
<%@page import="java.util.zip.ZipOutputStream"%>
|
||||||
|
<%@page import="java.io.FileNotFoundException"%>
|
||||||
|
<%@page import="java.io.IOException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
out.clear();
|
||||||
|
FileDownload fileDownload = new FileDownload(request, response);
|
||||||
|
|
||||||
|
String tempZipFilePath = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
String downloadFormData = request.getParameter("CD_DOWNLOAD_FILE_INFO");
|
||||||
|
if (downloadFormData == null)
|
||||||
|
throw new Exception("다운로드 중 예외가 발생했습니다.");
|
||||||
|
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(downloadFormData);
|
||||||
|
System.out.println("obj : " + obj);
|
||||||
|
|
||||||
|
JSONArray downloadFileInfoArray = (JSONArray)obj;
|
||||||
|
|
||||||
|
|
||||||
|
// JSONObject jsonObject = (JSONObject)downloadFileInfoArray.get(i);
|
||||||
|
// (String)jsonObject.get("fileId");
|
||||||
|
// (String)jsonObject.get("fileName"); // 필요할 경우 사용합니다.
|
||||||
|
// (String)jsonObject.get("fileSize"); // 필요할 경우 사용합니다.
|
||||||
|
// (String)jsonObject.get("fileUrl"); // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다
|
||||||
|
|
||||||
|
String fileNameAlias = "";
|
||||||
|
String filePath = request.getSession().getServletContext().getRealPath("NamoCrossUploaderH5Samples/DownloadFiles");
|
||||||
|
if(downloadFileInfoArray.size() == 1)
|
||||||
|
{
|
||||||
|
JSONObject jsonObject = (JSONObject)downloadFileInfoArray.get(0);
|
||||||
|
fileNameAlias = GetFileNameAlias((String)jsonObject.get("fileId"));
|
||||||
|
filePath += (File.separator + fileNameAlias);
|
||||||
|
}
|
||||||
|
else if(downloadFileInfoArray.size() > 1)
|
||||||
|
{
|
||||||
|
List filePathList = GetFilePathList(downloadFileInfoArray, filePath);
|
||||||
|
|
||||||
|
tempZipFilePath = CompressFiles(filePathList);
|
||||||
|
|
||||||
|
filePath = tempZipFilePath;
|
||||||
|
fileNameAlias = "download.zip";
|
||||||
|
}
|
||||||
|
|
||||||
|
// fileNameAlias는 웹서버 환경에 따라 적절히 인코딩 되어야 합니다.
|
||||||
|
fileNameAlias = URLEncoder.encode(fileNameAlias, "UTF-8");
|
||||||
|
|
||||||
|
// attachment 옵션에 따라 파일 종류에 관계 없이 항상 파일 저장 대화상자를 출력할 수 있습니다.
|
||||||
|
boolean attachment = true;
|
||||||
|
// resumable 옵션에 따라 파일 이어받기가 가능합니다.
|
||||||
|
// 클라이언트에서 이어받기 요청이 있어야 하며, 이어받기 요청이 없을 경우 일반 다운로드와 동일하게 동작합니다.
|
||||||
|
boolean resumable = true;
|
||||||
|
// filePath에 지정된 파일을 fileNameAlias 이름으로 다운로드 합니다.
|
||||||
|
fileDownload.startDownload(filePath, fileNameAlias, attachment, resumable);
|
||||||
|
|
||||||
|
|
||||||
|
// 다른 유형의 다운로드 함수들
|
||||||
|
// startDownload(String filePath);
|
||||||
|
// startDownload(String filePath, boolean attachment);
|
||||||
|
// startDownload(String filePath, boolean attachment, boolean resumable);
|
||||||
|
// startDownload(String filePath, String fileNameAlias);
|
||||||
|
|
||||||
|
//startDownload(filePath, fileNameAlias, attachment);
|
||||||
|
// startStreamDownload(InputStream inputStream, String fileNameAlias, long fileSize, boolean attachment);
|
||||||
|
}
|
||||||
|
catch(CrossUploaderException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(FileNotFoundException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(IOException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
%><%!
|
||||||
|
private List GetFilePathList(JSONArray downloadFileInfoArray, String filePath) throws Exception
|
||||||
|
{
|
||||||
|
List filePathList = new ArrayList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 설정
|
||||||
|
* DB 등에 저장된 파일의 정보를 가져옵니다. 샘플에서는 filePath 경로에 아래 파일들이 존재하는 것을 가정합니다.
|
||||||
|
*/
|
||||||
|
for (int i = 0; i < downloadFileInfoArray.size(); i++)
|
||||||
|
{
|
||||||
|
JSONObject downloadFileInfo = (JSONObject)downloadFileInfoArray.get(i);
|
||||||
|
System.out.println("GetFilePathList_downloadFileInfo :" + downloadFileInfo);
|
||||||
|
String fileId = (String)downloadFileInfo.get("fileId");
|
||||||
|
System.out.println("GetFilePathList_fileId :" + fileId);
|
||||||
|
|
||||||
|
String fileName = "";
|
||||||
|
if (fileId.compareTo("FILEID_0001") == 0)
|
||||||
|
fileName = "나모크로스에디터3_제품소개서.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0002") == 0)
|
||||||
|
fileName = "ActiveSquare 7_brochure.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0003") == 0)
|
||||||
|
fileName = "130617_나모_펍트리_브로셔_130702.pdf";
|
||||||
|
else
|
||||||
|
throw new Exception("다운로드 할 파일이 없습니다.");
|
||||||
|
|
||||||
|
filePathList.add(filePath + (File.separator + fileName));
|
||||||
|
|
||||||
|
System.out.println("GetFilePathList_filePathList :" + filePathList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return filePathList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String GetFileNameAlias(String fileId) throws Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 설정
|
||||||
|
* DB 등에 저장된 파일의 정보를 가져옵니다. 샘플에서는 아래 파일들이 존재하는 것을 가정합니다.
|
||||||
|
*/
|
||||||
|
String fileNameAlias = "";
|
||||||
|
if (fileId.compareTo("FILEID_0001") == 0)
|
||||||
|
fileNameAlias = "나모크로스에디터3_제품소개서.pdf.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0002") == 0)
|
||||||
|
fileNameAlias = "ActiveSquare 7_brochure.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0003") == 0)
|
||||||
|
fileNameAlias = "130617_나모_펍트리_브로셔_130702.pdf";
|
||||||
|
else
|
||||||
|
throw new Exception("다운로드 할 파일이 업습니다.");
|
||||||
|
|
||||||
|
return fileNameAlias;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String CompressFiles(List filePathList) throws IOException
|
||||||
|
{
|
||||||
|
final int BUFFER_SIZE = 1024 * 2;
|
||||||
|
final int COMPRESSION_LEVEL = 9;
|
||||||
|
String tempZipFilePath = "";
|
||||||
|
|
||||||
|
File tempZipFile= File.createTempFile("namo_download_", ".tmp");
|
||||||
|
FileOutputStream fos = new FileOutputStream(tempZipFile); // FileOutputStream;
|
||||||
|
BufferedOutputStream bos = new BufferedOutputStream(fos); // BufferedStream
|
||||||
|
ZipOutputStream zos = new ZipOutputStream(bos); // ZipOutputStream
|
||||||
|
zos.setLevel(COMPRESSION_LEVEL); // 압축 레벨 - 최대 압축률은 9, 디폴트 8
|
||||||
|
|
||||||
|
for(int i=0; i<filePathList.size(); i++) {
|
||||||
|
File sourceFile = new File((String)filePathList.get(i));
|
||||||
|
BufferedInputStream bis = null;
|
||||||
|
bis = new BufferedInputStream(new FileInputStream(sourceFile));
|
||||||
|
ZipEntry zentry = new ZipEntry(sourceFile.getName());
|
||||||
|
zentry.setTime(sourceFile.lastModified());
|
||||||
|
zos.putNextEntry(zentry);
|
||||||
|
|
||||||
|
byte[] buffer = new byte[BUFFER_SIZE];
|
||||||
|
int cnt = 0;
|
||||||
|
while ((cnt = bis.read(buffer, 0, BUFFER_SIZE)) != -1) {
|
||||||
|
zos.write(buffer, 0, cnt);
|
||||||
|
}
|
||||||
|
zos.closeEntry();
|
||||||
|
if (bis != null)
|
||||||
|
bis.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zos != null) {
|
||||||
|
zos.finish();
|
||||||
|
zos.close();
|
||||||
|
}
|
||||||
|
if (bos != null) {
|
||||||
|
bos.close();
|
||||||
|
}
|
||||||
|
if (fos != null) {
|
||||||
|
fos.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
tempZipFilePath = tempZipFile.getPath();
|
||||||
|
|
||||||
|
return tempZipFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>멀티플 파일 다운로드 예제입니다.</title>
|
||||||
|
|
||||||
|
<!-- 샘플 설명을 위한 화면 스타일입니다. 중요하지 않으며, 필요 없을 시 삭제해 주십시오. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
|
||||||
|
|
||||||
|
<!-- NamoCrossUploader Client HTML5 Edition 이 동작하기 위한 필수 파일입니다. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/slick.grid.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/smoothness/jquery-ui-1.8.16.custom.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/theme.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/css/namocrossuploader.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/contextmenu/jquery.contextMenu.css" />
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery-1.11.3.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery.event.drag-2.2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.grid.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.dataview.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.checkboxselectcolumn.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.rowselectionmodel.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader-config.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.contextMenu.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.ui.position.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="content_title_area">
|
||||||
|
<div class="content_title">샘플 설명</div>
|
||||||
|
<div class="content_desc">멀티플 파일 다운로드 예제입니다. 2개 이상의 파일을 다운로드 할 경우 하나의 파일로 압축하여 다운로드 합니다.</div>
|
||||||
|
<div class="content_title">샘플 경로</div>
|
||||||
|
<div class="content_desc">Samples/Download/MultipleFileDownload</div>
|
||||||
|
</div><br />
|
||||||
|
|
||||||
|
<div id="downloaderContainer" class="form_area">
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
var addFiles = function ()
|
||||||
|
{
|
||||||
|
var fileIdArray = new Array('FILEID_0001', 'FILEID_0002', 'FILEID_0003');
|
||||||
|
var fileNameArray = new Array('나모크로스에디터3_제품소개서.pdf', 'ActiveSquare 7_brochure.pdf', '130617_나모_펍트리_브로셔_130702.pdf');
|
||||||
|
var fileSizeArray = new Array('2210715', '2816868', '2717166');
|
||||||
|
|
||||||
|
for (var i = 0; i < fileIdArray.length; i++) {
|
||||||
|
var fileInfo = new Object();
|
||||||
|
fileInfo.fileId = fileIdArray[i];
|
||||||
|
fileInfo.fileName = fileNameArray[i];
|
||||||
|
fileInfo.fileSize = fileSizeArray[i];
|
||||||
|
fileInfo.fileUrl = ''; // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다.
|
||||||
|
|
||||||
|
downloader.addFile(JSON.stringify(fileInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
downloader.scrollRow(0); // 첫번째 파일 위치로 스크롤 이동
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전체 파일 삭제
|
||||||
|
*/
|
||||||
|
var deleteAllFiles = function ()
|
||||||
|
{
|
||||||
|
downloader.deleteAllFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossDownloader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
var namoCrossUploader = new __NamoCrossUploader();
|
||||||
|
var downloadUrl = window.namoCrossUploaderConfig.productPath + 'Download/MultipleFileDownload/DownloadProcess.jsp';
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = '436'; // FileDownloadManager 너비
|
||||||
|
managerProperties.height = '280'; // FileDownloadManager 높이
|
||||||
|
managerProperties.containerId = 'downloaderContainer'; // FileDownloadManager 객체가 생성될 html div 태그 id
|
||||||
|
managerProperties.uiMode = 'MULTIPLE'; // FileDownloadManager UI 모드 설정
|
||||||
|
managerProperties.downloadUrl = downloadUrl; // 다운로드 처리 페이지
|
||||||
|
|
||||||
|
var downloader = namoCrossUploader.createDownloader(
|
||||||
|
JSON.stringify(managerProperties)); // FileDownloadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
addFiles();
|
||||||
|
</script>
|
||||||
|
<br />
|
||||||
|
<input type="button" value="파일 추가" onclick="addFiles()" />
|
||||||
|
<input type="button" value="전체 파일 삭제" onclick="deleteAllFiles()" />
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8"%>
|
||||||
|
<%@page import="com.namo.crossuploader.*"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="java.net.URLEncoder"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
<%@page import="java.util.List"%>
|
||||||
|
<%@page import="java.util.ArrayList"%>
|
||||||
|
<%@page import="java.io.BufferedInputStream"%>
|
||||||
|
<%@page import="java.io.BufferedOutputStream"%>
|
||||||
|
<%@page import="java.io.File"%>
|
||||||
|
<%@page import="java.io.FileInputStream"%>
|
||||||
|
<%@page import="java.io.FileOutputStream"%>
|
||||||
|
<%@page import="java.util.zip.ZipEntry"%>
|
||||||
|
<%@page import="java.util.zip.ZipInputStream"%>
|
||||||
|
<%@page import="java.util.zip.ZipOutputStream"%>
|
||||||
|
<%@page import="java.io.FileNotFoundException"%>
|
||||||
|
<%@page import="java.io.IOException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
out.clear();
|
||||||
|
FileDownload fileDownload = new FileDownload(request, response);
|
||||||
|
|
||||||
|
String tempZipFilePath = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
String downloadFormData = request.getParameter("CD_DOWNLOAD_FILE_INFO");
|
||||||
|
if (downloadFormData == null)
|
||||||
|
throw new Exception("다운로드 중 예외가 발생했습니다.");
|
||||||
|
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(downloadFormData);
|
||||||
|
System.out.println("obj : " + obj);
|
||||||
|
|
||||||
|
JSONArray downloadFileInfoArray = (JSONArray)obj;
|
||||||
|
|
||||||
|
|
||||||
|
// JSONObject jsonObject = (JSONObject)downloadFileInfoArray.get(i);
|
||||||
|
// (String)jsonObject.get("fileId");
|
||||||
|
// (String)jsonObject.get("fileName"); // 필요할 경우 사용합니다.
|
||||||
|
// (String)jsonObject.get("fileSize"); // 필요할 경우 사용합니다.
|
||||||
|
// (String)jsonObject.get("fileUrl"); // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다
|
||||||
|
|
||||||
|
String fileNameAlias = "";
|
||||||
|
String filePath = request.getSession().getServletContext().getRealPath("NamoCrossUploaderH5Samples/DownloadFiles");
|
||||||
|
if(downloadFileInfoArray.size() == 1)
|
||||||
|
{
|
||||||
|
JSONObject jsonObject = (JSONObject)downloadFileInfoArray.get(0);
|
||||||
|
fileNameAlias = GetFileNameAlias((String)jsonObject.get("fileId"));
|
||||||
|
filePath += (File.separator + fileNameAlias);
|
||||||
|
}
|
||||||
|
else if(downloadFileInfoArray.size() > 1)
|
||||||
|
{
|
||||||
|
List filePathList = GetFilePathList(downloadFileInfoArray, filePath);
|
||||||
|
|
||||||
|
tempZipFilePath = CompressFiles(filePathList);
|
||||||
|
|
||||||
|
filePath = tempZipFilePath;
|
||||||
|
fileNameAlias = "download.zip";
|
||||||
|
}
|
||||||
|
|
||||||
|
// fileNameAlias는 웹서버 환경에 따라 적절히 인코딩 되어야 합니다.
|
||||||
|
fileNameAlias = URLEncoder.encode(fileNameAlias, "UTF-8");
|
||||||
|
|
||||||
|
// attachment 옵션에 따라 파일 종류에 관계 없이 항상 파일 저장 대화상자를 출력할 수 있습니다.
|
||||||
|
boolean attachment = true;
|
||||||
|
// resumable 옵션에 따라 파일 이어받기가 가능합니다.
|
||||||
|
// 클라이언트에서 이어받기 요청이 있어야 하며, 이어받기 요청이 없을 경우 일반 다운로드와 동일하게 동작합니다.
|
||||||
|
boolean resumable = true;
|
||||||
|
// filePath에 지정된 파일을 fileNameAlias 이름으로 다운로드 합니다.
|
||||||
|
fileDownload.startDownload(filePath, fileNameAlias, attachment, resumable);
|
||||||
|
|
||||||
|
|
||||||
|
// 다른 유형의 다운로드 함수들
|
||||||
|
// startDownload(String filePath);
|
||||||
|
// startDownload(String filePath, boolean attachment);
|
||||||
|
// startDownload(String filePath, boolean attachment, boolean resumable);
|
||||||
|
// startDownload(String filePath, String fileNameAlias);
|
||||||
|
|
||||||
|
//startDownload(filePath, fileNameAlias, attachment);
|
||||||
|
// startStreamDownload(InputStream inputStream, String fileNameAlias, long fileSize, boolean attachment);
|
||||||
|
}
|
||||||
|
catch(CrossUploaderException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(FileNotFoundException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(IOException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
%><%!
|
||||||
|
private List GetFilePathList(JSONArray downloadFileInfoArray, String filePath) throws Exception
|
||||||
|
{
|
||||||
|
List filePathList = new ArrayList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 설정
|
||||||
|
* DB 등에 저장된 파일의 정보를 가져옵니다. 샘플에서는 filePath 경로에 아래 파일들이 존재하는 것을 가정합니다.
|
||||||
|
*/
|
||||||
|
for (int i = 0; i < downloadFileInfoArray.size(); i++)
|
||||||
|
{
|
||||||
|
JSONObject downloadFileInfo = (JSONObject)downloadFileInfoArray.get(i);
|
||||||
|
System.out.println("GetFilePathList_downloadFileInfo :" + downloadFileInfo);
|
||||||
|
String fileId = (String)downloadFileInfo.get("fileId");
|
||||||
|
System.out.println("GetFilePathList_fileId :" + fileId);
|
||||||
|
|
||||||
|
String fileName = "";
|
||||||
|
if (fileId.compareTo("FILEID_0001") == 0)
|
||||||
|
fileName = "나모크로스에디터3_제품소개서.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0002") == 0)
|
||||||
|
fileName = "ActiveSquare 7_brochure.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0003") == 0)
|
||||||
|
fileName = "130617_나모_펍트리_브로셔_130702.pdf";
|
||||||
|
else
|
||||||
|
throw new Exception("다운로드 할 파일이 없습니다.");
|
||||||
|
|
||||||
|
filePathList.add(filePath + (File.separator + fileName));
|
||||||
|
|
||||||
|
System.out.println("GetFilePathList_filePathList :" + filePathList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return filePathList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String GetFileNameAlias(String fileId) throws Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 설정
|
||||||
|
* DB 등에 저장된 파일의 정보를 가져옵니다. 샘플에서는 아래 파일들이 존재하는 것을 가정합니다.
|
||||||
|
*/
|
||||||
|
String fileNameAlias = "";
|
||||||
|
if (fileId.compareTo("FILEID_0001") == 0)
|
||||||
|
fileNameAlias = "나모크로스에디터3_제품소개서.pdf.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0002") == 0)
|
||||||
|
fileNameAlias = "ActiveSquare 7_brochure.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0003") == 0)
|
||||||
|
fileNameAlias = "130617_나모_펍트리_브로셔_130702.pdf";
|
||||||
|
else
|
||||||
|
throw new Exception("다운로드 할 파일이 업습니다.");
|
||||||
|
|
||||||
|
return fileNameAlias;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String CompressFiles(List filePathList) throws IOException
|
||||||
|
{
|
||||||
|
final int BUFFER_SIZE = 1024 * 2;
|
||||||
|
final int COMPRESSION_LEVEL = 9;
|
||||||
|
String tempZipFilePath = "";
|
||||||
|
|
||||||
|
File tempZipFile= File.createTempFile("namo_download_", ".tmp");
|
||||||
|
FileOutputStream fos = new FileOutputStream(tempZipFile); // FileOutputStream;
|
||||||
|
BufferedOutputStream bos = new BufferedOutputStream(fos); // BufferedStream
|
||||||
|
ZipOutputStream zos = new ZipOutputStream(bos); // ZipOutputStream
|
||||||
|
zos.setLevel(COMPRESSION_LEVEL); // 압축 레벨 - 최대 압축률은 9, 디폴트 8
|
||||||
|
|
||||||
|
for(int i=0; i<filePathList.size(); i++) {
|
||||||
|
File sourceFile = new File((String)filePathList.get(i));
|
||||||
|
BufferedInputStream bis = null;
|
||||||
|
bis = new BufferedInputStream(new FileInputStream(sourceFile));
|
||||||
|
ZipEntry zentry = new ZipEntry(sourceFile.getName());
|
||||||
|
zentry.setTime(sourceFile.lastModified());
|
||||||
|
zos.putNextEntry(zentry);
|
||||||
|
|
||||||
|
byte[] buffer = new byte[BUFFER_SIZE];
|
||||||
|
int cnt = 0;
|
||||||
|
while ((cnt = bis.read(buffer, 0, BUFFER_SIZE)) != -1) {
|
||||||
|
zos.write(buffer, 0, cnt);
|
||||||
|
}
|
||||||
|
zos.closeEntry();
|
||||||
|
if (bis != null)
|
||||||
|
bis.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zos != null) {
|
||||||
|
zos.finish();
|
||||||
|
zos.close();
|
||||||
|
}
|
||||||
|
if (bos != null) {
|
||||||
|
bos.close();
|
||||||
|
}
|
||||||
|
if (fos != null) {
|
||||||
|
fos.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
tempZipFilePath = tempZipFile.getPath();
|
||||||
|
|
||||||
|
return tempZipFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>싱글 파일 다운로드 예제입니다.</title>
|
||||||
|
|
||||||
|
<!-- 샘플 설명을 위한 화면 스타일입니다. 중요하지 않으며, 필요 없을 시 삭제해 주십시오. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
|
||||||
|
|
||||||
|
<!-- NamoCrossUploader Client HTML5 Edition 이 동작하기 위한 필수 파일입니다. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/slick.grid.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/smoothness/jquery-ui-1.8.16.custom.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/theme.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/css/namocrossuploader.css" />
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery-1.11.3.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery.event.drag-2.2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.grid.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.dataview.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.formatters.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.checkboxselectcolumn.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.rowselectionmodel.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader-config.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.contextMenu.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.ui.position.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/contextmenu/jquery.contextMenu.css" />
|
||||||
|
<!-- -->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="content_title_area">
|
||||||
|
<div class="content_title">샘플 설명</div>
|
||||||
|
<div class="content_desc">싱글 파일 다운로드 예제입니다.</div>
|
||||||
|
<div class="content_title">샘플 경로</div>
|
||||||
|
<div class="content_desc">Samples/Download/SingleFileDownload</div>
|
||||||
|
</div><br />
|
||||||
|
|
||||||
|
<div id="downloaderContainer" class="form_area">
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
var addFiles = function ()
|
||||||
|
{
|
||||||
|
var fileIdArray = new Array('FILEID_0001', 'FILEID_0002', 'FILEID_0003');
|
||||||
|
var fileNameArray = new Array('나모크로스에디터3_제품소개서.pdf', 'ActiveSquare 7_brochure.pdf', '130617_나모_펍트리_브로셔_130702.pdf');
|
||||||
|
var fileSizeArray = new Array('2210715', '2816868', '2717166');
|
||||||
|
|
||||||
|
for (var i = 0; i < fileIdArray.length; i++) {
|
||||||
|
var fileInfo = new Object();
|
||||||
|
fileInfo.fileId = fileIdArray[i];
|
||||||
|
fileInfo.fileName = fileNameArray[i];
|
||||||
|
fileInfo.fileSize = fileSizeArray[i];
|
||||||
|
fileInfo.fileUrl = downloadUrl; // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다.
|
||||||
|
|
||||||
|
downloader.addFile(JSON.stringify(fileInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
downloader.scrollRow(0); // 첫번째 파일 위치로 스크롤 이동
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전체 파일 삭제
|
||||||
|
*/
|
||||||
|
var deleteAllFiles = function ()
|
||||||
|
{
|
||||||
|
downloader.deleteAllFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossDownloader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
var namoCrossUploader = new __NamoCrossUploader();
|
||||||
|
var downloadUrl = window.namoCrossUploaderConfig.productPath + 'Download/SingleFileDownload/DownloadProcess.jsp';
|
||||||
|
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = '436'; // FileDownloadManager 너비
|
||||||
|
managerProperties.height = '280'; // FileDownloadManager 높이
|
||||||
|
managerProperties.containerId = 'downloaderContainer'; // FileDownloadManager 객체가 생성될 html div 태그 id
|
||||||
|
managerProperties.uiMode = 'SINGLE'; // FileDownloadManager UI 모드 설정
|
||||||
|
//managerProperties.downloadUrl = downloadUrl; // 다운로드 처리 페이지
|
||||||
|
|
||||||
|
var downloader = namoCrossUploader.createDownloader(
|
||||||
|
JSON.stringify(managerProperties)); // FileDownloadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
addFiles();
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<input type="button" value="파일 추가" onclick="addFiles()" />
|
||||||
|
<input type="button" value="전체 파일 삭제" onclick="deleteAllFiles()" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,183 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8"%>
|
||||||
|
<%@page import="com.namo.crossuploader.*"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="java.net.URLEncoder"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
<%@page import="java.util.List"%>
|
||||||
|
<%@page import="java.util.ArrayList"%>
|
||||||
|
<%@page import="java.io.BufferedInputStream"%>
|
||||||
|
<%@page import="java.io.BufferedOutputStream"%>
|
||||||
|
<%@page import="java.io.File"%>
|
||||||
|
<%@page import="java.io.FileInputStream"%>
|
||||||
|
<%@page import="java.io.FileOutputStream"%>
|
||||||
|
<%@page import="java.util.zip.ZipEntry"%>
|
||||||
|
<%@page import="java.util.zip.ZipInputStream"%>
|
||||||
|
<%@page import="java.util.zip.ZipOutputStream"%>
|
||||||
|
<%@page import="java.io.FileNotFoundException"%>
|
||||||
|
<%@page import="java.io.IOException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
out.clear();
|
||||||
|
FileDownload fileDownload = new FileDownload(request, response);
|
||||||
|
|
||||||
|
String tempZipFilePath = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
String downloadFormData = request.getParameter("CD_DOWNLOAD_FILE_INFO");
|
||||||
|
if (downloadFormData == null)
|
||||||
|
throw new Exception("다운로드 중 예외가 발생했습니다.");
|
||||||
|
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(downloadFormData);
|
||||||
|
|
||||||
|
|
||||||
|
//JSONObject jsonObject = (JSONObject)downloadFileInfoArray.get(i);
|
||||||
|
//(String)jsonObject.get("fileId");
|
||||||
|
//(String)jsonObject.get("fileName"); // 필요할 경우 사용합니다.
|
||||||
|
//(String)jsonObject.get("fileSize"); // 필요할 경우 사용합니다.
|
||||||
|
//(String)jsonObject.get("fileUrl"); // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다
|
||||||
|
|
||||||
|
String fileNameAlias = "";
|
||||||
|
String filePath = request.getSession().getServletContext().getRealPath("NamoCrossUploaderH5Samples/DownloadFiles");
|
||||||
|
|
||||||
|
JSONObject jsonObject = (JSONObject)obj;
|
||||||
|
fileNameAlias = GetFileNameAlias((String)jsonObject.get("fileId"));
|
||||||
|
filePath += (File.separator + fileNameAlias);
|
||||||
|
// fileNameAlias는 웹서버 환경에 따라 적절히 인코딩 되어야 합니다.
|
||||||
|
fileNameAlias = URLEncoder.encode(fileNameAlias, "UTF-8");
|
||||||
|
|
||||||
|
// attachment 옵션에 따라 파일 종류에 관계 없이 항상 파일 저장 대화상자를 출력할 수 있습니다.
|
||||||
|
boolean attachment = true;
|
||||||
|
// resumable 옵션에 따라 파일 이어받기가 가능합니다.
|
||||||
|
// 클라이언트에서 이어받기 요청이 있어야 하며, 이어받기 요청이 없을 경우 일반 다운로드와 동일하게 동작합니다.
|
||||||
|
boolean resumable = true;
|
||||||
|
// filePath에 지정된 파일을 fileNameAlias 이름으로 다운로드 합니다.
|
||||||
|
fileDownload.startDownload(filePath, fileNameAlias, attachment, resumable);
|
||||||
|
|
||||||
|
|
||||||
|
// 다른 유형의 다운로드 함수들
|
||||||
|
// startDownload(String filePath);
|
||||||
|
// startDownload(String filePath, boolean attachment);
|
||||||
|
// startDownload(String filePath, boolean attachment, boolean resumable);
|
||||||
|
// startDownload(String filePath, String fileNameAlias);
|
||||||
|
// startDownload(String filePath, String fileNameAlias, boolean attachment);
|
||||||
|
// startStreamDownload(InputStream inputStream, String fileNameAlias, long fileSize, boolean attachment);
|
||||||
|
}
|
||||||
|
catch(CrossUploaderException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(FileNotFoundException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(IOException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
%><%!
|
||||||
|
private List GetFilePathList(JSONArray downloadFileInfoArray, String filePath) throws Exception
|
||||||
|
{
|
||||||
|
List filePathList = new ArrayList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 설정
|
||||||
|
* DB 등에 저장된 파일의 정보를 가져옵니다. 샘플에서는 filePath 경로에 아래 파일들이 존재하는 것을 가정합니다.
|
||||||
|
*/
|
||||||
|
for (int i = 0; i < downloadFileInfoArray.size(); i++)
|
||||||
|
{
|
||||||
|
JSONObject downloadFileInfo = (JSONObject)downloadFileInfoArray.get(i);
|
||||||
|
String fileId = (String)downloadFileInfo.get("fileId");
|
||||||
|
|
||||||
|
String fileName = "";
|
||||||
|
if (fileId.compareTo("FILEID_0001") == 0)
|
||||||
|
fileName = "나모크로스에디터3_제품소개서.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0002") == 0)
|
||||||
|
fileName = "ActiveSquare 7_brochure.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0003") == 0)
|
||||||
|
fileName = "130617_나모_펍트리_브로셔_130702.pdf";
|
||||||
|
else
|
||||||
|
throw new Exception("다운로드 할 파일이 없습니다.");
|
||||||
|
|
||||||
|
filePathList.add(filePath + (File.separator + fileName));
|
||||||
|
}
|
||||||
|
|
||||||
|
return filePathList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String GetFileNameAlias(String fileId) throws Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 설정
|
||||||
|
* DB 등에 저장된 파일의 정보를 가져옵니다. 샘플에서는 아래 파일들이 존재하는 것을 가정합니다.
|
||||||
|
*/
|
||||||
|
String fileNameAlias = "";
|
||||||
|
if (fileId.compareTo("FILEID_0001") == 0)
|
||||||
|
fileNameAlias = "나모크로스에디터3_제품소개서.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0002") == 0)
|
||||||
|
fileNameAlias = "ActiveSquare 7_brochure.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0003") == 0)
|
||||||
|
fileNameAlias = "130617_나모_펍트리_브로셔_130702.pdf";
|
||||||
|
else
|
||||||
|
throw new Exception("다운로드 할 파일이 업습니다.");
|
||||||
|
|
||||||
|
return fileNameAlias;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String CompressFiles(List filePathList) throws IOException
|
||||||
|
{
|
||||||
|
final int BUFFER_SIZE = 1024 * 2;
|
||||||
|
final int COMPRESSION_LEVEL = 9;
|
||||||
|
String tempZipFilePath = "";
|
||||||
|
|
||||||
|
File tempZipFile= File.createTempFile("namo_download_", ".tmp");
|
||||||
|
FileOutputStream fos = new FileOutputStream(tempZipFile); // FileOutputStream;
|
||||||
|
BufferedOutputStream bos = new BufferedOutputStream(fos); // BufferedStream
|
||||||
|
ZipOutputStream zos = new ZipOutputStream(bos); // ZipOutputStream
|
||||||
|
zos.setLevel(COMPRESSION_LEVEL); // 압축 레벨 - 최대 압축률은 9, 디폴트 8
|
||||||
|
|
||||||
|
for(int i=0; i<filePathList.size(); i++) {
|
||||||
|
File sourceFile = new File((String)filePathList.get(i));
|
||||||
|
BufferedInputStream bis = null;
|
||||||
|
bis = new BufferedInputStream(new FileInputStream(sourceFile));
|
||||||
|
ZipEntry zentry = new ZipEntry(sourceFile.getName());
|
||||||
|
zentry.setTime(sourceFile.lastModified());
|
||||||
|
zos.putNextEntry(zentry);
|
||||||
|
|
||||||
|
byte[] buffer = new byte[BUFFER_SIZE];
|
||||||
|
int cnt = 0;
|
||||||
|
while ((cnt = bis.read(buffer, 0, BUFFER_SIZE)) != -1) {
|
||||||
|
zos.write(buffer, 0, cnt);
|
||||||
|
}
|
||||||
|
zos.closeEntry();
|
||||||
|
if (bis != null)
|
||||||
|
bis.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zos != null) {
|
||||||
|
zos.finish();
|
||||||
|
zos.close();
|
||||||
|
}
|
||||||
|
if (bos != null) {
|
||||||
|
bos.close();
|
||||||
|
}
|
||||||
|
if (fos != null) {
|
||||||
|
fos.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
tempZipFilePath = tempZipFile.getPath();
|
||||||
|
|
||||||
|
return tempZipFilePath;
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>다운로드 리스트에 추가된 파일의 정보를 가져오는 예제입니다.</title>
|
||||||
|
|
||||||
|
<!-- 샘플 설명을 위한 화면 스타일입니다. 중요하지 않으며, 필요 없을 시 삭제해 주십시오. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
|
||||||
|
|
||||||
|
<!-- NamoCrossUploader Client HTML5 Edition 이 동작하기 위한 필수 파일입니다. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/slick.grid.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/smoothness/jquery-ui-1.8.16.custom.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/theme.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/css/namocrossuploader.css" />
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery-1.11.3.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery.event.drag-2.2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.grid.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.dataview.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.checkboxselectcolumn.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.rowselectionmodel.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader-config.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.contextMenu.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.ui.position.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/contextmenu/jquery.contextMenu.css" />
|
||||||
|
<!-- -->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="content_title_area">
|
||||||
|
<div class="content_title">샘플 설명</div>
|
||||||
|
<div class="content_desc">다운로드 리스트에 추가된 파일의 정보를 가져오는 예제입니다.</div>
|
||||||
|
<div class="content_title">샘플 경로</div>
|
||||||
|
<div class="content_desc">Samples/Others/GetDownloadFileInfo</div>
|
||||||
|
</div><br />
|
||||||
|
|
||||||
|
<div id="downloaderContainer" class="form_area">
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossDownloader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
var namoCrossUploader = new __NamoCrossUploader();
|
||||||
|
var downloadUrl = window.namoCrossUploaderConfig.productPath + 'Others/GetDownloadFileInfo/DownloadProcess.jsp';
|
||||||
|
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = '436'; // FileDownloadManager 너비
|
||||||
|
managerProperties.height = '280'; // FileDownloadManager 높이
|
||||||
|
managerProperties.containerId = 'downloaderContainer'; // FileDownloadManager 객체가 생성될 html div 태그 id
|
||||||
|
managerProperties.uiMode = 'MULTIPLE'; // FileDownloadManager UI 모드 설정
|
||||||
|
managerProperties.downloadUrl = downloadUrl; // 다운로드 처리 페이지
|
||||||
|
|
||||||
|
var downloader = namoCrossUploader.createDownloader(
|
||||||
|
JSON.stringify(managerProperties)); // FileDownloadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 추가
|
||||||
|
*/
|
||||||
|
var fileIdArray = new Array('FILEID_0001', 'FILEID_0002', 'FILEID_0003');
|
||||||
|
var fileNameArray = new Array('나모크로스에디터3_제품소개서.pdf', 'ActiveSquare 7_brochure.pdf', '130617_나모_펍트리_브로셔_130702.pdf');
|
||||||
|
var fileSizeArray = new Array('2210715', '2816868', '2717166');
|
||||||
|
|
||||||
|
for (var i = 0; i < fileIdArray.length; i++) {
|
||||||
|
var fileInfo = new Object();
|
||||||
|
fileInfo.fileId = fileIdArray[i];
|
||||||
|
fileInfo.fileName = fileNameArray[i];
|
||||||
|
fileInfo.fileSize = fileSizeArray[i];
|
||||||
|
fileInfo.fileUrl = ''; // 각 파일의 URL이 다를 경우 사용합니다.
|
||||||
|
|
||||||
|
downloader.addFile(JSON.stringify(fileInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
downloader.scrollRow(0); // 첫번째 파일 위치로 스크롤 이동
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 파일의 정보를 가져옵니다.
|
||||||
|
*/
|
||||||
|
var getFilesInfo = function () {
|
||||||
|
var totalFileCount = downloader.getTotalFileCount();
|
||||||
|
|
||||||
|
for (i = 0; i < totalFileCount; i++) {
|
||||||
|
var obj = jQuery.parseJSON(downloader.getFileInfoAt(i));
|
||||||
|
alert("[" + i + "번째 파일의 정보]\n" +
|
||||||
|
"fileId : " + obj.fileId + "\n" +
|
||||||
|
"fileName : " + obj.fileName + "\n" +
|
||||||
|
"fileSize : " + obj.fileSize + "\n" +
|
||||||
|
"fileUrl: " + obj.fileUrl
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<br /><input type="button" id="getFilesInfo" value="파일정보 가져오기" onclick="getFilesInfo()" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8"%>
|
||||||
|
<%@page import="com.namo.crossuploader.*"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="java.net.URLEncoder"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
<%@page import="java.util.List"%>
|
||||||
|
<%@page import="java.util.ArrayList"%>
|
||||||
|
<%@page import="java.io.BufferedInputStream"%>
|
||||||
|
<%@page import="java.io.BufferedOutputStream"%>
|
||||||
|
<%@page import="java.io.File"%>
|
||||||
|
<%@page import="java.io.FileInputStream"%>
|
||||||
|
<%@page import="java.io.FileOutputStream"%>
|
||||||
|
<%@page import="java.util.zip.ZipEntry"%>
|
||||||
|
<%@page import="java.util.zip.ZipInputStream"%>
|
||||||
|
<%@page import="java.util.zip.ZipOutputStream"%>
|
||||||
|
<%@page import="java.io.FileNotFoundException"%>
|
||||||
|
<%@page import="java.io.IOException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
out.clear();
|
||||||
|
FileDownload fileDownload = new FileDownload(request, response);
|
||||||
|
|
||||||
|
String tempZipFilePath = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
String downloadFormData = request.getParameter("CD_DOWNLOAD_FILE_INFO");
|
||||||
|
if (downloadFormData == null)
|
||||||
|
throw new Exception("다운로드 중 예외가 발생했습니다.");
|
||||||
|
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(downloadFormData);
|
||||||
|
System.out.println("obj : " + obj);
|
||||||
|
|
||||||
|
JSONArray downloadFileInfoArray = (JSONArray)obj;
|
||||||
|
|
||||||
|
|
||||||
|
// JSONObject jsonObject = (JSONObject)downloadFileInfoArray.get(i);
|
||||||
|
// (String)jsonObject.get("fileId");
|
||||||
|
// (String)jsonObject.get("fileName"); // 필요할 경우 사용합니다.
|
||||||
|
// (String)jsonObject.get("fileSize"); // 필요할 경우 사용합니다.
|
||||||
|
// (String)jsonObject.get("fileUrl"); // 각 파일의 URL이 다르거나 SingleFileDownload일 때 사용됩니다
|
||||||
|
|
||||||
|
String fileNameAlias = "";
|
||||||
|
String filePath = request.getRealPath("/NamoCrossUploaderH5Samples/Samples/Download/DownloadFiles");//서버 환경에 맞게 구성
|
||||||
|
|
||||||
|
if(downloadFileInfoArray.size() == 1)
|
||||||
|
{
|
||||||
|
JSONObject jsonObject = (JSONObject)downloadFileInfoArray.get(0);
|
||||||
|
fileNameAlias = GetFileNameAlias((String)jsonObject.get("fileId"));
|
||||||
|
filePath += (File.separator + fileNameAlias);
|
||||||
|
}
|
||||||
|
else if(downloadFileInfoArray.size() > 1)
|
||||||
|
{
|
||||||
|
List filePathList = GetFilePathList(downloadFileInfoArray, filePath);
|
||||||
|
|
||||||
|
tempZipFilePath = CompressFiles(filePathList);
|
||||||
|
System.out.println("tempZipFilePath :" + tempZipFilePath);
|
||||||
|
|
||||||
|
filePath = tempZipFilePath;
|
||||||
|
fileNameAlias = "download.zip";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// fileNameAlias는 웹서버 환경에 따라 적절히 인코딩 되어야 합니다.
|
||||||
|
fileNameAlias = URLEncoder.encode(fileNameAlias, "UTF-8");
|
||||||
|
|
||||||
|
// attachment 옵션에 따라 파일 종류에 관계 없이 항상 파일 저장 대화상자를 출력할 수 있습니다.
|
||||||
|
boolean attachment = true;
|
||||||
|
// resumable 옵션에 따라 파일 이어받기가 가능합니다.
|
||||||
|
// 클라이언트에서 이어받기 요청이 있어야 하며, 이어받기 요청이 없을 경우 일반 다운로드와 동일하게 동작합니다.
|
||||||
|
boolean resumable = true;
|
||||||
|
// filePath에 지정된 파일을 fileNameAlias 이름으로 다운로드 합니다.
|
||||||
|
fileDownload.startDownload(filePath, fileNameAlias, attachment, resumable);
|
||||||
|
|
||||||
|
|
||||||
|
// 다른 유형의 다운로드 함수들
|
||||||
|
// startDownload(String filePath);
|
||||||
|
// startDownload(String filePath, boolean attachment);
|
||||||
|
// startDownload(String filePath, boolean attachment, boolean resumable);
|
||||||
|
// startDownload(String filePath, String fileNameAlias);
|
||||||
|
// startDownload(String filePath, String fileNameAlias, boolean attachment);
|
||||||
|
// startStreamDownload(InputStream inputStream, String fileNameAlias, long fileSize, boolean attachment);
|
||||||
|
}
|
||||||
|
catch(CrossUploaderException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(FileNotFoundException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(IOException ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
System.out.println("다운로드 중 예외 발생 : " + ex.getMessage());
|
||||||
|
}
|
||||||
|
%><%!
|
||||||
|
private List GetFilePathList(JSONArray downloadFileInfoArray, String filePath) throws Exception
|
||||||
|
{
|
||||||
|
List filePathList = new ArrayList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 설정
|
||||||
|
* DB 등에 저장된 파일의 정보를 가져옵니다. 샘플에서는 filePath 경로에 아래 파일들이 존재하는 것을 가정합니다.
|
||||||
|
*/
|
||||||
|
for (int i = 0; i < downloadFileInfoArray.size(); i++)
|
||||||
|
{
|
||||||
|
JSONObject downloadFileInfo = (JSONObject)downloadFileInfoArray.get(i);
|
||||||
|
System.out.println("GetFilePathList_downloadFileInfo :" + downloadFileInfo);
|
||||||
|
String fileId = (String)downloadFileInfo.get("fileId");
|
||||||
|
System.out.println("GetFilePathList_fileId :" + fileId);
|
||||||
|
|
||||||
|
String fileName = "";
|
||||||
|
if (fileId.compareTo("FILEID_0001") == 0)
|
||||||
|
fileName = "나모크로스에디터3_제품소개서.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0002") == 0)
|
||||||
|
fileName = "ActiveSquare 7_brochure.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0003") == 0)
|
||||||
|
fileName = "130617_나모_펍트리_브로셔_130702.pdf";
|
||||||
|
else
|
||||||
|
throw new Exception("다운로드 할 파일이 없습니다.");
|
||||||
|
|
||||||
|
filePathList.add(filePath + (File.separator + fileName));
|
||||||
|
|
||||||
|
System.out.println("GetFilePathList_filePathList :" + filePathList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return filePathList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String GetFileNameAlias(String fileId) throws Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 다운로드 할 파일 설정
|
||||||
|
* DB 등에 저장된 파일의 정보를 가져옵니다. 샘플에서는 아래 파일들이 존재하는 것을 가정합니다.
|
||||||
|
*/
|
||||||
|
String fileNameAlias = "";
|
||||||
|
if (fileId.compareTo("FILEID_0001") == 0)
|
||||||
|
fileNameAlias = "나모크로스에디터3_제품소개서.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0002") == 0)
|
||||||
|
fileNameAlias = "ActiveSquare 7_brochure.pdf";
|
||||||
|
else if (fileId.compareTo("FILEID_0003") == 0)
|
||||||
|
fileNameAlias = "130617_나모_펍트리_브로셔_130702.pdf";
|
||||||
|
else
|
||||||
|
throw new Exception("다운로드 할 파일이 업습니다.");
|
||||||
|
return fileNameAlias;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String CompressFiles(List filePathList) throws IOException
|
||||||
|
{
|
||||||
|
final int BUFFER_SIZE = 1024 * 2;
|
||||||
|
final int COMPRESSION_LEVEL = 9;
|
||||||
|
String tempZipFilePath = "";
|
||||||
|
|
||||||
|
File tempZipFile= File.createTempFile("namo_download_", ".tmp");
|
||||||
|
FileOutputStream fos = new FileOutputStream(tempZipFile); // FileOutputStream;
|
||||||
|
BufferedOutputStream bos = new BufferedOutputStream(fos); // BufferedStream
|
||||||
|
ZipOutputStream zos = new ZipOutputStream(bos); // ZipOutputStream
|
||||||
|
zos.setLevel(COMPRESSION_LEVEL); // 압축 레벨 - 최대 압축률은 9, 디폴트 8
|
||||||
|
|
||||||
|
for(int i=0; i<filePathList.size(); i++) {
|
||||||
|
File sourceFile = new File((String)filePathList.get(i));
|
||||||
|
BufferedInputStream bis = null;
|
||||||
|
bis = new BufferedInputStream(new FileInputStream(sourceFile));
|
||||||
|
ZipEntry zentry = new ZipEntry(sourceFile.getName());
|
||||||
|
zentry.setTime(sourceFile.lastModified());
|
||||||
|
zos.putNextEntry(zentry);
|
||||||
|
|
||||||
|
byte[] buffer = new byte[BUFFER_SIZE];
|
||||||
|
int cnt = 0;
|
||||||
|
while ((cnt = bis.read(buffer, 0, BUFFER_SIZE)) != -1) {
|
||||||
|
zos.write(buffer, 0, cnt);
|
||||||
|
}
|
||||||
|
zos.closeEntry();
|
||||||
|
if (bis != null)
|
||||||
|
bis.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zos != null) {
|
||||||
|
zos.finish();
|
||||||
|
zos.close();
|
||||||
|
}
|
||||||
|
if (bos != null) {
|
||||||
|
bos.close();
|
||||||
|
}
|
||||||
|
if (fos != null) {
|
||||||
|
fos.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
tempZipFilePath = tempZipFile.getPath();
|
||||||
|
|
||||||
|
return tempZipFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
request.setCharacterEncoding("UTF-8");
|
||||||
|
PrintWriter writer = response.getWriter();
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlHeader(writer);
|
||||||
|
|
||||||
|
try {
|
||||||
|
/**
|
||||||
|
* 업로드 된 정보를 출력합니다.
|
||||||
|
* 샘플에서는 JSON 타입으로 데이터를 교환하고 있습니다. 필요 시 다른 형식으로 조합해서 사용하실 수 있습니다.
|
||||||
|
*/
|
||||||
|
String uploadedFilesInfo = request.getParameter("uploadedFilesInfo");
|
||||||
|
if(uploadedFilesInfo != null) {
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(uploadedFilesInfo);
|
||||||
|
JSONArray jsonArray = (JSONArray)obj;
|
||||||
|
for(int i=0; i<jsonArray.size(); i++) {
|
||||||
|
//JSONObject jsonObject = (JSONObject)jsonArray.get(i);
|
||||||
|
/**
|
||||||
|
* UploadProcess.jsp에서 보낸 정보입니다.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
String name = (String)jsonObject.get("name");
|
||||||
|
String fileName = (String)jsonObject.get("fileName");
|
||||||
|
String lastSavedDirectoryPath = (String)jsonObject.get("lastSavedDirectoryPath");
|
||||||
|
String lastSavedFilePath = (String)jsonObject.get("lastSavedFilePath");
|
||||||
|
String lastSavedFileName = (String)jsonObject.get("lastSavedFileName");
|
||||||
|
String fileSize = (String)jsonObject.get("fileSize");
|
||||||
|
String fileNameWithoutFileExt = (String)jsonObject.get("fileNameWithoutFileExt");
|
||||||
|
String fileExtension = (String)jsonObject.get("fileExtension");
|
||||||
|
String contentType = (String)jsonObject.get("contentType");
|
||||||
|
String isSaved = (String)jsonObject.get("isSaved");
|
||||||
|
String isEmptyFile = (String)jsonObject.get("isEmptyFile");
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
// 업로드 정보 출력
|
||||||
|
printFileUploadResult(obj, writer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ParseException ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlFooter(writer);
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%!
|
||||||
|
public void printFileUploadResult(Object obj, PrintWriter writer) {
|
||||||
|
if(obj == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String html = "";
|
||||||
|
JSONArray jsonArray = (JSONArray)obj;
|
||||||
|
for(int i=0; i<jsonArray.size(); i++) {
|
||||||
|
JSONObject jsonObject = (JSONObject)jsonArray.get(i);
|
||||||
|
html += "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>" + (i+1) + "번째 파일 업로드 정보</b></td><tr>";
|
||||||
|
html += "<tr><td>Name</td><td>" + (String)jsonObject.get("name") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Name</td><td>" + (String)jsonObject.get("fileName") + "</td></tr>";
|
||||||
|
html += "<tr><td>Last Saved Directory Path</td><td>" + (String)jsonObject.get("lastSavedDirectoryPath") + "</td></tr>";
|
||||||
|
html += "<tr><td>Last Saved File Path</td><td>" + (String)jsonObject.get("lastSavedFilePath") + "</td></tr>";
|
||||||
|
html += "<tr><td>Last Saved File Name</td><td>" + (String)jsonObject.get("lastSavedFileName") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Size</td><td>" + (String)jsonObject.get("fileSize") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Name without File Ext</td><td>" + (String)jsonObject.get("fileNameWithoutFileExt") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Extension</td><td>" + (String)jsonObject.get("fileExtension") + "</td></tr>";
|
||||||
|
html += "<tr><td>Content Type</td><td>" + (String)jsonObject.get("contentType") + "</td></tr>";
|
||||||
|
html += "<tr><td>Is Saved</td><td>" + (String)jsonObject.get("isSaved") + "</td></tr>";
|
||||||
|
html += "<tr><td>Is EmptyFile</td><td>" + (String)jsonObject.get("isEmptyFile") + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
}
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printExceptionMessage(String message, PrintWriter writer) {
|
||||||
|
String html = "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>예외가 발생했습니다.</b></td><tr>";
|
||||||
|
html += "<tr><td>예외 메시지: </td><td>" + message + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlHeader(PrintWriter writer) {
|
||||||
|
String html = "<html><head>";
|
||||||
|
html += "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";
|
||||||
|
html += "<link rel='stylesheet' type='text/css' href='../../css/common.css'/>";
|
||||||
|
html += "<title>파일 업로드 정보입니다</title></head>";
|
||||||
|
html += "<body>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlFooter(PrintWriter writer) {
|
||||||
|
writer.println("</body></html>");
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
request.setCharacterEncoding("UTF-8");
|
||||||
|
PrintWriter writer = response.getWriter();
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlHeader(writer);
|
||||||
|
|
||||||
|
try {
|
||||||
|
/**
|
||||||
|
* 기존에 업로드 된 정보를 삭제합니다.
|
||||||
|
* 샘플에서는 JSON 타입으로 데이터를 교환하고 있습니다. 필요 시 다른 형식으로 조합해서 사용하실 수 있습니다.
|
||||||
|
*/
|
||||||
|
String uploadedFilesInfo = request.getParameter("uploadedFilesInfo");
|
||||||
|
String osName = System.getProperty("os.name");
|
||||||
|
if(uploadedFilesInfo != null) {
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(uploadedFilesInfo);
|
||||||
|
JSONArray jsonArray = (JSONArray)obj;
|
||||||
|
for(int i=0; i<jsonArray.size(); i++) {
|
||||||
|
JSONObject jsonObject = (JSONObject)jsonArray.get(i);
|
||||||
|
/**
|
||||||
|
* UploadProcess.jsp에서 보낸 정보입니다.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
String name = (String)jsonObject.get("name");
|
||||||
|
String fileName = (String)jsonObject.get("fileName");
|
||||||
|
String lastSavedDirectoryPath = (String)jsonObject.get("lastSavedDirectoryPath");
|
||||||
|
String lastSavedFilePath = (String)jsonObject.get("lastSavedFilePath");
|
||||||
|
String lastSavedFileName = (String)jsonObject.get("lastSavedFileName");
|
||||||
|
String fileSize = (String)jsonObject.get("fileSize");
|
||||||
|
String fileNameWithoutFileExt = (String)jsonObject.get("fileNameWithoutFileExt");
|
||||||
|
String fileExtension = (String)jsonObject.get("fileExtension");
|
||||||
|
String contentType = (String)jsonObject.get("contentType");
|
||||||
|
String isSaved = (String)jsonObject.get("isSaved");
|
||||||
|
String isEmptyFile = (String)jsonObject.get("isEmptyFile");
|
||||||
|
*/
|
||||||
|
String lastSavedFilePath = (String)jsonObject.get("lastSavedFilePath");
|
||||||
|
if(lastSavedFilePath != null) {
|
||||||
|
File delFile = new File(lastSavedFilePath);
|
||||||
|
if(delFile.exists() && delFile.isFile()) {
|
||||||
|
delFile.delete();
|
||||||
|
// 삭제된 파일 정보 출력
|
||||||
|
printDeletedFilesInfo(lastSavedFilePath, writer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ParseException ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlFooter(writer);
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%!
|
||||||
|
public void printDeletedFilesInfo(String delFile, PrintWriter writer) {
|
||||||
|
if(delFile == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String html = "";
|
||||||
|
html += "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>삭제된 파일 정보</b></td><tr>";
|
||||||
|
html += "<tr><td>Deleted File</td><td>" + delFile + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printExceptionMessage(String message, PrintWriter writer) {
|
||||||
|
String html = "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>예외가 발생했습니다.</b></td><tr>";
|
||||||
|
html += "<tr><td>예외 메시지: </td><td>" + message + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlHeader(PrintWriter writer) {
|
||||||
|
String html = "<html><head>";
|
||||||
|
html += "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";
|
||||||
|
html += "<link rel='stylesheet' type='text/css' href='../../css/common.css'/>";
|
||||||
|
html += "<title>파일 업로드 정보입니다</title></head>";
|
||||||
|
html += "<body>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlFooter(PrintWriter writer) {
|
||||||
|
writer.println("</body></html>");
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,212 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>업로드 리스트에 추가된 파일의 정보를 가져오는 예제입니다.</title>
|
||||||
|
|
||||||
|
<!-- 샘플 설명을 위한 화면 스타일입니다. 중요하지 않으며, 필요 없을 시 삭제해 주십시오. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
|
||||||
|
|
||||||
|
<!-- NamoCrossUploader Client HTML5 Edition 이 동작하기 위한 필수 파일입니다. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/slick.grid.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/smoothness/jquery-ui-1.8.16.custom.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/theme.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/css/namocrossuploader.css" />
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery-1.11.3.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery.event.drag-2.2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.grid.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.dataview.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.checkboxselectcolumn.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.rowselectionmodel.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader-config.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.contextMenu.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.ui.position.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/contextmenu/jquery.contextMenu.css" />
|
||||||
|
<!-- -->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="content_title_area">
|
||||||
|
<div class="content_title">샘플 설명</div>
|
||||||
|
<div class="content_desc">업로드 리스트에 추가된 파일의 정보를 가져오는 예제입니다.</div>
|
||||||
|
<div class="content_title">샘플 경로</div>
|
||||||
|
<div class="content_desc">Samples/Others/GetUploadFileInfo</div>
|
||||||
|
</div><br />
|
||||||
|
|
||||||
|
<div id="uploaderContainer" class="form_area">
|
||||||
|
<form name="dataForm" method="post" action="DataProcess.jsp">
|
||||||
|
<!-- 파일 정보를 저장할 폼 데이터 -->
|
||||||
|
<input type="hidden" name="uploadedFilesInfo" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossUploader Event를 설정합니다.
|
||||||
|
* 아래의 Event 이름들은 namocrossuploader-config.js 파일에서 변경하실 수 있습니다.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 업로드 시작 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onStartUploadCu = function () {
|
||||||
|
// alert('업로드가 시작됐습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onStartUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert("[" + rowIndex + "번째 파일의 정보]\n" +
|
||||||
|
"FileType : " + obj.fileType + " (NORMAL:파일, UPLOADED:업로드된 파일)\n" +
|
||||||
|
"FileId : " + obj.fileId + "\n" +
|
||||||
|
"FileName : " + obj.fileName + "\n" +
|
||||||
|
"FileSize : " + obj.fileSize + "\n" +
|
||||||
|
"Status : " + obj.status + "\n" +
|
||||||
|
"IsDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"FileType, FileId, IsDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onEndUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert("[" + rowIndex + "번째 파일의 정보]\n" +
|
||||||
|
"FileType : " + obj.fileType + " (NORMAL:파일, UPLOADED:업로드된 파일)\n" +
|
||||||
|
"FileId : " + obj.fileId + "\n" +
|
||||||
|
"FileName : " + obj.fileName + "\n" +
|
||||||
|
"FileSize : " + obj.fileSize + "\n" +
|
||||||
|
"Status : " + obj.status + "\n" +
|
||||||
|
"IsDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"FileType, FileId, IsDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 업로드 완료 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onEndUploadCu = function () {
|
||||||
|
// alert('업로드가 완료됐습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전송창이 닫힐 때 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onCloseMonitorWindowCu = function () {
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
// onEndUploadCu 나 onCloseMonitorWindowCu 이벤트 시점에 처리하시면 되며,
|
||||||
|
// onCloseMonitorWindowCu 시에는 getUploadStatus()를 호출하여 업로드 완료되어 있는지 체크해 주십시오.
|
||||||
|
if (uploader.getUploadStatus() == 'COMPLETION') {
|
||||||
|
|
||||||
|
// 업로드된 전체 파일의 정보를 가져옵니다.
|
||||||
|
var uploadedFilesInfo = uploader.getUploadedFilesInfo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 필요 시, 아래처럼 사용해 주십시오. (JSON으로 넘오올 경우)
|
||||||
|
var obj = jQuery.parseJSON(uploadedFilesInfo);
|
||||||
|
alertTimeout(obj.length);
|
||||||
|
alertTimeout(obj[0].name);
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onCancelUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert('[개별 파일에 대한 업로드 취소 정보]\n' +
|
||||||
|
'FileName : ' + obj.fileName + '\n' +
|
||||||
|
'FileSize : ' + obj.fileSize + '\n'
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 예외 발생 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onExceptionCu = function () {
|
||||||
|
// 300~ : 일반적 예외
|
||||||
|
// 400~ : 시스템 예외
|
||||||
|
// 500~ : 서측에서 발생한 예외
|
||||||
|
// 필요한 예외정보만 고객에서 보여주십시오.
|
||||||
|
var exceptionInfo = uploader.getLastExceptionInfo();
|
||||||
|
var obj = jQuery.parseJSON(exceptionInfo);
|
||||||
|
alert('[예외 정보]\n' + 'code : ' + obj.code + '\n' + 'message : ' + obj.message + '\n' + 'detailMessage : ' + obj.detailMessage);
|
||||||
|
|
||||||
|
if (parseInt(obj.code, 10) > 400000) {
|
||||||
|
var uploadedFilesInfo = uploader.getUploadedFilesInfo();
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.action = "ErrorProcess.jsp";
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossUploader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
var namoCrossUploader = new __NamoCrossUploader();
|
||||||
|
var uploadUrl = window.namoCrossUploaderConfig.productPath + 'Others/GetUploadFileInfo/UploadProcess.jsp';
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = '436'; // FileUploadManager 너비
|
||||||
|
managerProperties.height = '280'; // FileUploadManager 높이
|
||||||
|
managerProperties.containerId = 'uploaderContainer';// FileUploadManager 객체가 생성될 html div 태그 id
|
||||||
|
managerProperties.uploadUrl = uploadUrl; // 파일 업로드 처리 페이지 경로
|
||||||
|
|
||||||
|
var monitorProperties = new Object();
|
||||||
|
monitorProperties.monitorLayerClass = 'monitorLayer'; // FileUploadMonitor 창의 스타일입니다. (namocrossuploader.css 파일에 정의, 변경 가능)
|
||||||
|
monitorProperties.monitorBgLayerClass = 'monitorBgLayer'; // FileUploadMonitor 창의 백그라운드 스타일입니다. (namocrossuploader.css 파일에 정의, 변경 가능)
|
||||||
|
monitorProperties.closeMonitorCheckBoxChecked = true; // 전송 완료 후 FileUploadMonitor 창 닫기 설정
|
||||||
|
|
||||||
|
var uploader = namoCrossUploader.createUploader(
|
||||||
|
JSON.stringify(managerProperties), // FileUploadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(monitorProperties), // FileUploadMonitor 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(window.namoCrossUploaderConfig.eventNames)); // 이벤트 이름을 JSON 문자열로 전달
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 파일의 정보를 가져옵니다.
|
||||||
|
*/
|
||||||
|
var getFilesInfo = function () {
|
||||||
|
var totalFileCount = uploader.getTotalFileCount();
|
||||||
|
|
||||||
|
if(totalFileCount == 0){
|
||||||
|
alert("파일이 목록에 없습니다.");
|
||||||
|
}else{
|
||||||
|
|
||||||
|
for (i = 0; i < totalFileCount; i++) {
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(i));
|
||||||
|
alert("[" + i + "번째 파일의 정보]\n" +
|
||||||
|
"fileType : " + obj.fileType + " (NORMAL:파일 UPLOADED:업로드된 파일)\n" +
|
||||||
|
"fileId : " + obj.fileId + "\n" +
|
||||||
|
"fileName : " + obj.fileName + "\n" +
|
||||||
|
"fileSize : " + obj.fileSize + "\n" +
|
||||||
|
"status : " + obj.status + "\n" +
|
||||||
|
"isDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"fileType, fileId, isDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<br /><input type="button" id="getFilesInfo" value="파일정보 가져오기" onclick="getFilesInfo()" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@page import="com.namo.crossuploader.*"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
PrintWriter writer = response.getWriter();
|
||||||
|
FileUpload fileUpload = new FileUpload(request, response);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// autoMakeDirs를 true로 설정하면 파일 저장 및 이동시 파일생성에 필요한 상위 디렉토리를 모두 생성합니다.
|
||||||
|
fileUpload.setAutoMakeDirs(true);
|
||||||
|
|
||||||
|
// 파일을 저장할 경로를 설정합니다.
|
||||||
|
String saveDirPath = request.getRealPath("/");
|
||||||
|
saveDirPath += ("UploadDir" + File.separator);
|
||||||
|
|
||||||
|
// saveDirPath에 지정한 경로로 파일 업로드를 시작합니다.
|
||||||
|
fileUpload.startUpload(saveDirPath);
|
||||||
|
|
||||||
|
// 업로드 경로를 지정하지 않을 경우, 시스템의 임시 디렉토리로 파일 업로드를 시작합니다.
|
||||||
|
// fileUpload.startUpload();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 입력한 file 태그의 name을 키로 갖는 FileItem[] 객체를 리턴합니다.
|
||||||
|
* NamoCrossUploader Client Flex Edition의 name은 "CU_FILE" 입니다.
|
||||||
|
*/
|
||||||
|
FileItem fileItem = fileUpload.getFileItem("CU_FILE");
|
||||||
|
|
||||||
|
if(fileItem != null) {
|
||||||
|
// saveDirPath 경로에 원본 파일명으로 저장(이동)합니다. 동일한 파일명이 존재할 경우 다른 이름으로 저장됩니다.
|
||||||
|
fileItem.save(saveDirPath);
|
||||||
|
|
||||||
|
// 다른 유형의 저장(이동) 함수들
|
||||||
|
/*
|
||||||
|
save();
|
||||||
|
save(String saveDirPath, boolean overwrite);
|
||||||
|
saveAs(String saveDirPath, String fileName);
|
||||||
|
saveAs(String saveDirPath, String fileName, boolean overwrite);
|
||||||
|
*/
|
||||||
|
|
||||||
|
// FileItem 객체로 아래와 같은 정보를 가져올 수 있습니다. 추가적으로 필요한 정보가 있을 경우 JSONObject 객체에 추가해 주십시오.
|
||||||
|
// 교환할 데이터는 JSON 타입이 아니어도 되며, Javascript에서 파싱할 적절한 형태로 조합하시면 됩니다.
|
||||||
|
// LastSavedDirectoryPath, LastSavedFileName에는 Windwos 경로에 대한 예외처리가 되어 있습니다. 서버 환경에 맞게 적절히 수정해 주십시오.
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("name", fileItem.getName());
|
||||||
|
jsonObject.put("fileName", fileItem.getFileName());
|
||||||
|
jsonObject.put("lastSavedDirectoryPath", fileItem.getLastSavedDirPath().replaceAll("\\\\", "/"));
|
||||||
|
jsonObject.put("lastSavedFilePath", fileItem.getLastSavedFilePath().replaceAll("\\\\", "/"));
|
||||||
|
jsonObject.put("lastSavedFileName", fileItem.getLastSavedFileName());
|
||||||
|
jsonObject.put("fileSize", Long.toString(fileItem.getFileSize()));
|
||||||
|
jsonObject.put("fileNameWithoutFileExt", fileItem.getFileNameWithoutFileExt());
|
||||||
|
jsonObject.put("fileExtension", fileItem.getFileExtension());
|
||||||
|
jsonObject.put("contentType", fileItem.getContentType());
|
||||||
|
jsonObject.put("isSaved", Boolean.toString(fileItem.isSaved()));
|
||||||
|
jsonObject.put("isEmptyFile", Boolean.toString(fileItem.isEmptyFile()));
|
||||||
|
|
||||||
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
jsonObject.writeJSONString(stringWriter);
|
||||||
|
writer.println(jsonObject.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(CrossUploaderException ex) {
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
// 업로드 외 로직에서 예외 발생시 업로드 중인 모든 파일을 삭제합니다.
|
||||||
|
fileUpload.deleteUploadedFiles();
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// 파일 업로드 객체에서 사용한 자원을 해제합니다.
|
||||||
|
fileUpload.clear();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
request.setCharacterEncoding("UTF-8");
|
||||||
|
PrintWriter writer = response.getWriter();
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlHeader(writer);
|
||||||
|
|
||||||
|
try {
|
||||||
|
/**
|
||||||
|
* 업로드 된 정보를 출력합니다.
|
||||||
|
* 샘플에서는 JSON 타입으로 데이터를 교환하고 있습니다. 필요 시 다른 형식으로 조합해서 사용하실 수 있습니다.
|
||||||
|
*/
|
||||||
|
String uploadedFilesInfo = request.getParameter("uploadedFilesInfo");
|
||||||
|
if(uploadedFilesInfo != null) {
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(uploadedFilesInfo);
|
||||||
|
JSONArray jsonArray = (JSONArray)obj;
|
||||||
|
for(int i=0; i<jsonArray.size(); i++) {
|
||||||
|
//JSONObject jsonObject = (JSONObject)jsonArray.get(i);
|
||||||
|
/**
|
||||||
|
* UploadProcess.jsp에서 보낸 정보입니다.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
String name = (String)jsonObject.get("name");
|
||||||
|
String fileName = (String)jsonObject.get("fileName");
|
||||||
|
String lastSavedDirectoryPath = (String)jsonObject.get("lastSavedDirectoryPath");
|
||||||
|
String lastSavedFilePath = (String)jsonObject.get("lastSavedFilePath");
|
||||||
|
String lastSavedFileName = (String)jsonObject.get("lastSavedFileName");
|
||||||
|
String fileSize = (String)jsonObject.get("fileSize");
|
||||||
|
String fileNameWithoutFileExt = (String)jsonObject.get("fileNameWithoutFileExt");
|
||||||
|
String fileExtension = (String)jsonObject.get("fileExtension");
|
||||||
|
String contentType = (String)jsonObject.get("contentType");
|
||||||
|
String isSaved = (String)jsonObject.get("isSaved");
|
||||||
|
String isEmptyFile = (String)jsonObject.get("isEmptyFile");
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
// 업로드 정보 출력
|
||||||
|
printFileUploadResult(obj, writer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ParseException ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlFooter(writer);
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%!
|
||||||
|
public void printFileUploadResult(Object obj, PrintWriter writer) {
|
||||||
|
if(obj == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String html = "";
|
||||||
|
JSONArray jsonArray = (JSONArray)obj;
|
||||||
|
for(int i=0; i<jsonArray.size(); i++) {
|
||||||
|
JSONObject jsonObject = (JSONObject)jsonArray.get(i);
|
||||||
|
html += "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>" + (i+1) + "번째 파일 업로드 정보</b></td><tr>";
|
||||||
|
html += "<tr><td>Name</td><td>" + (String)jsonObject.get("name") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Name</td><td>" + (String)jsonObject.get("fileName") + "</td></tr>";
|
||||||
|
html += "<tr><td>Last Saved Directory Path</td><td>" + (String)jsonObject.get("lastSavedDirectoryPath") + "</td></tr>";
|
||||||
|
html += "<tr><td>Last Saved File Path</td><td>" + (String)jsonObject.get("lastSavedFilePath") + "</td></tr>";
|
||||||
|
html += "<tr><td>Last Saved File Name</td><td>" + (String)jsonObject.get("lastSavedFileName") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Size</td><td>" + (String)jsonObject.get("fileSize") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Name without File Ext</td><td>" + (String)jsonObject.get("fileNameWithoutFileExt") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Extension</td><td>" + (String)jsonObject.get("fileExtension") + "</td></tr>";
|
||||||
|
html += "<tr><td>Content Type</td><td>" + (String)jsonObject.get("contentType") + "</td></tr>";
|
||||||
|
html += "<tr><td>Is Saved</td><td>" + (String)jsonObject.get("isSaved") + "</td></tr>";
|
||||||
|
html += "<tr><td>Is EmptyFile</td><td>" + (String)jsonObject.get("isEmptyFile") + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
}
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printExceptionMessage(String message, PrintWriter writer) {
|
||||||
|
String html = "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>예외가 발생했습니다.</b></td><tr>";
|
||||||
|
html += "<tr><td>예외 메시지: </td><td>" + message + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlHeader(PrintWriter writer) {
|
||||||
|
String html = "<html><head>";
|
||||||
|
html += "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";
|
||||||
|
html += "<link rel='stylesheet' type='text/css' href='../../css/common.css'/>";
|
||||||
|
html += "<title>파일 업로드 정보입니다</title></head>";
|
||||||
|
html += "<body>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlFooter(PrintWriter writer) {
|
||||||
|
writer.println("</body></html>");
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
request.setCharacterEncoding("UTF-8");
|
||||||
|
PrintWriter writer = response.getWriter();
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlHeader(writer);
|
||||||
|
|
||||||
|
try {
|
||||||
|
/**
|
||||||
|
* 기존에 업로드 된 정보를 삭제합니다.
|
||||||
|
* 샘플에서는 JSON 타입으로 데이터를 교환하고 있습니다. 필요 시 다른 형식으로 조합해서 사용하실 수 있습니다.
|
||||||
|
*/
|
||||||
|
String uploadedFilesInfo = request.getParameter("uploadedFilesInfo");
|
||||||
|
String osName = System.getProperty("os.name");
|
||||||
|
if(uploadedFilesInfo != null) {
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(uploadedFilesInfo);
|
||||||
|
JSONArray jsonArray = (JSONArray)obj;
|
||||||
|
for(int i=0; i<jsonArray.size(); i++) {
|
||||||
|
JSONObject jsonObject = (JSONObject)jsonArray.get(i);
|
||||||
|
/**
|
||||||
|
* UploadProcess.jsp에서 보낸 정보입니다.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
String name = (String)jsonObject.get("name");
|
||||||
|
String fileName = (String)jsonObject.get("fileName");
|
||||||
|
String lastSavedDirectoryPath = (String)jsonObject.get("lastSavedDirectoryPath");
|
||||||
|
String lastSavedFilePath = (String)jsonObject.get("lastSavedFilePath");
|
||||||
|
String lastSavedFileName = (String)jsonObject.get("lastSavedFileName");
|
||||||
|
String fileSize = (String)jsonObject.get("fileSize");
|
||||||
|
String fileNameWithoutFileExt = (String)jsonObject.get("fileNameWithoutFileExt");
|
||||||
|
String fileExtension = (String)jsonObject.get("fileExtension");
|
||||||
|
String contentType = (String)jsonObject.get("contentType");
|
||||||
|
String isSaved = (String)jsonObject.get("isSaved");
|
||||||
|
String isEmptyFile = (String)jsonObject.get("isEmptyFile");
|
||||||
|
*/
|
||||||
|
String lastSavedFilePath = (String)jsonObject.get("lastSavedFilePath");
|
||||||
|
if(lastSavedFilePath != null) {
|
||||||
|
File delFile = new File(lastSavedFilePath);
|
||||||
|
if(delFile.exists() && delFile.isFile()) {
|
||||||
|
delFile.delete();
|
||||||
|
// 삭제된 파일 정보 출력
|
||||||
|
printDeletedFilesInfo(lastSavedFilePath, writer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ParseException ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlFooter(writer);
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%!
|
||||||
|
public void printDeletedFilesInfo(String delFile, PrintWriter writer) {
|
||||||
|
if(delFile == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String html = "";
|
||||||
|
html += "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>삭제된 파일 정보</b></td><tr>";
|
||||||
|
html += "<tr><td>Deleted File</td><td>" + delFile + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printExceptionMessage(String message, PrintWriter writer) {
|
||||||
|
String html = "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>예외가 발생했습니다.</b></td><tr>";
|
||||||
|
html += "<tr><td>예외 메시지: </td><td>" + message + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlHeader(PrintWriter writer) {
|
||||||
|
String html = "<html><head>";
|
||||||
|
html += "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";
|
||||||
|
html += "<link rel='stylesheet' type='text/css' href='../../css/common.css'/>";
|
||||||
|
html += "<title>파일 업로드 정보입니다</title></head>";
|
||||||
|
html += "<body>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlFooter(PrintWriter writer) {
|
||||||
|
writer.println("</body></html>");
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>업로드 목록 및 전송정보를 초기화 하는 예제입니다.</title>
|
||||||
|
|
||||||
|
<!-- 샘플 설명을 위한 화면 스타일입니다. 중요하지 않으며, 필요 없을 시 삭제해 주십시오. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
|
||||||
|
|
||||||
|
<!-- NamoCrossUploader Client HTML5 Edition 이 동작하기 위한 필수 파일입니다. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/slick.grid.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/smoothness/jquery-ui-1.8.16.custom.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/theme.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/css/namocrossuploader.css" />
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery-1.11.3.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery.event.drag-2.2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.grid.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.dataview.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.checkboxselectcolumn.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.rowselectionmodel.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader-config.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.contextMenu.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.ui.position.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/contextmenu/jquery.contextMenu.css" />
|
||||||
|
<!-- -->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="content_title_area">
|
||||||
|
<div class="content_title">샘플 설명</div>
|
||||||
|
<div class="content_desc">
|
||||||
|
업로드 목록 및 전송정보를 초기화 하는 예제입니다.<br />
|
||||||
|
<font color="red">
|
||||||
|
전송 중 취소를 하고 초기화를 진행할 경우, 기존에 업로드 된 데이터를 삭제해 주셔야 합니다. "예외처리" 샘플을 참고하여 주십시오.<br />
|
||||||
|
Ajax를 적용하면 화면전환 없이 기존에 업로드 된 파일을 삭제하실 수 있습니다.
|
||||||
|
</font>
|
||||||
|
</div>
|
||||||
|
<div class="content_title">샘플 경로</div>
|
||||||
|
<div class="content_desc">Samples/Others/InitUploadFileInfo</div>
|
||||||
|
</div><br />
|
||||||
|
|
||||||
|
<div id="uploaderContainer" class="form_area">
|
||||||
|
<form name="dataForm" method="post" action="DataProcess.jsp">
|
||||||
|
<!-- 파일 정보를 저장할 폼 데이터 -->
|
||||||
|
<input type="hidden" name="uploadedFilesInfo" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossUploader Event를 설정합니다.
|
||||||
|
* 아래의 Event 이름들은 namocrossuploader-config.js 파일에서 변경하실 수 있습니다.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 업로드 시작 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onStartUploadCu = function () {
|
||||||
|
// alert('업로드가 시작됐습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onStartUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert("[" + rowIndex + "번째 파일의 정보]\n" +
|
||||||
|
"FileType : " + obj.fileType + " (NORMAL:파일, UPLOADED:업로드된 파일)\n" +
|
||||||
|
"FileId : " + obj.fileId + "\n" +
|
||||||
|
"FileName : " + obj.fileName + "\n" +
|
||||||
|
"FileSize : " + obj.fileSize + "\n" +
|
||||||
|
"Status : " + obj.status + "\n" +
|
||||||
|
"IsDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"FileType, FileId, IsDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onEndUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert("[" + rowIndex + "번째 파일의 정보]\n" +
|
||||||
|
"FileType : " + obj.fileType + " (NORMAL:파일, UPLOADED:업로드된 파일)\n" +
|
||||||
|
"FileId : " + obj.fileId + "\n" +
|
||||||
|
"FileName : " + obj.fileName + "\n" +
|
||||||
|
"FileSize : " + obj.fileSize + "\n" +
|
||||||
|
"Status : " + obj.status + "\n" +
|
||||||
|
"IsDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"FileType, FileId, IsDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 업로드 완료 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onEndUploadCu = function () {
|
||||||
|
// alert('업로드가 완료됐습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전송창이 닫힐 때 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onCloseMonitorWindowCu = function () {
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
// onEndUploadCu 나 onCloseMonitorWindowCu 이벤트 시점에 처리하시면 되며,
|
||||||
|
// onCloseMonitorWindowCu 시에는 getUploadStatus()를 호출하여 업로드 완료되어 있는지 체크해 주십시오.
|
||||||
|
if (uploader.getUploadStatus() == 'COMPLETION') {
|
||||||
|
|
||||||
|
// 업로드된 전체 파일의 정보를 가져옵니다.
|
||||||
|
var uploadedFilesInfo = uploader.getUploadedFilesInfo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 필요 시, 아래처럼 사용해 주십시오. (JSON으로 넘오올 경우)
|
||||||
|
var obj = jQuery.parseJSON(uploadedFilesInfo);
|
||||||
|
alertTimeout(obj.length);
|
||||||
|
alertTimeout(obj[0].name);
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onCancelUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert('[개별 파일에 대한 업로드 취소 정보]\n' +
|
||||||
|
'FileName : ' + obj.fileName + '\n' +
|
||||||
|
'FileSize : ' + obj.fileSize + '\n'
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 예외 발생 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onExceptionCu = function () {
|
||||||
|
// 300~ : 일반적 예외
|
||||||
|
// 400~ : 시스템 예외
|
||||||
|
// 500~ : 서측에서 발생한 예외
|
||||||
|
// 필요한 예외정보만 고객에서 보여주십시오.
|
||||||
|
var exceptionInfo = uploader.getLastExceptionInfo();
|
||||||
|
var obj = jQuery.parseJSON(exceptionInfo);
|
||||||
|
alert('[예외 정보]\n' + 'code : ' + obj.code + '\n' + 'message : ' + obj.message + '\n' + 'detailMessage : ' + obj.detailMessage);
|
||||||
|
|
||||||
|
if (parseInt(obj.code, 10) > 400000) {
|
||||||
|
var uploadedFilesInfo = uploader.getUploadedFilesInfo();
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.action = "ErrorProcess.jsp";
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossUploader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
var namoCrossUploader = new __NamoCrossUploader();
|
||||||
|
var uploadUrl = window.namoCrossUploaderConfig.productPath + 'Others/InitUploadFileInfo/UploadProcess.jsp';
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = '436'; // FileUploadManager 너비
|
||||||
|
managerProperties.height = '280'; // FileUploadManager 높이
|
||||||
|
managerProperties.containerId = 'uploaderContainer';// FileUploadManager 객체가 생성될 html div 태그 id
|
||||||
|
managerProperties.uploadUrl = uploadUrl; // 파일 업로드 처리 페이지 경로
|
||||||
|
|
||||||
|
var monitorProperties = new Object();
|
||||||
|
monitorProperties.monitorLayerClass = 'monitorLayer'; // FileUploadMonitor 창의 스타일입니다. (namocrossuploader.css 파일에 정의, 변경 가능)
|
||||||
|
monitorProperties.monitorBgLayerClass = 'monitorBgLayer'; // FileUploadMonitor 창의 백그라운드 스타일입니다. (namocrossuploader.css 파일에 정의, 변경 가능)
|
||||||
|
monitorProperties.closeMonitorCheckBoxChecked = true; // 전송 완료 후 FileUploadMonitor 창 닫기 설정
|
||||||
|
|
||||||
|
var uploader = namoCrossUploader.createUploader(
|
||||||
|
JSON.stringify(managerProperties), // FileUploadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(monitorProperties), // FileUploadMonitor 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(window.namoCrossUploaderConfig.eventNames)); // 이벤트 이름을 JSON 문자열로 전달
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전체 초기화
|
||||||
|
*/
|
||||||
|
var initFilesInfo = function () {
|
||||||
|
if (uploader.getUploadStatus() == "TRANSFERRING") {
|
||||||
|
alert("전송중에는 초기화 할 수 없습니다.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
uploader.initFilesInfo();
|
||||||
|
alert("업로드 목록 및 전송정보를 초기화 했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<br /><input type="button" id="initFilesInfo" value="전체 초기화" onclick="initFilesInfo()" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@page import="com.namo.crossuploader.*"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
PrintWriter writer = response.getWriter();
|
||||||
|
FileUpload fileUpload = new FileUpload(request, response);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// autoMakeDirs를 true로 설정하면 파일 저장 및 이동시 파일생성에 필요한 상위 디렉토리를 모두 생성합니다.
|
||||||
|
fileUpload.setAutoMakeDirs(true);
|
||||||
|
|
||||||
|
// 파일을 저장할 경로를 설정합니다.
|
||||||
|
String saveDirPath = request.getRealPath("/");
|
||||||
|
saveDirPath += ("UploadDir" + File.separator);
|
||||||
|
|
||||||
|
// saveDirPath에 지정한 경로로 파일 업로드를 시작합니다.
|
||||||
|
fileUpload.startUpload(saveDirPath);
|
||||||
|
|
||||||
|
// 업로드 경로를 지정하지 않을 경우, 시스템의 임시 디렉토리로 파일 업로드를 시작합니다.
|
||||||
|
// fileUpload.startUpload();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 입력한 file 태그의 name을 키로 갖는 FileItem[] 객체를 리턴합니다.
|
||||||
|
* NamoCrossUploader Client Flex Edition의 name은 "CU_FILE" 입니다.
|
||||||
|
*/
|
||||||
|
FileItem fileItem = fileUpload.getFileItem("CU_FILE");
|
||||||
|
|
||||||
|
if(fileItem != null) {
|
||||||
|
// saveDirPath 경로에 원본 파일명으로 저장(이동)합니다. 동일한 파일명이 존재할 경우 다른 이름으로 저장됩니다.
|
||||||
|
fileItem.save(saveDirPath);
|
||||||
|
|
||||||
|
// 다른 유형의 저장(이동) 함수들
|
||||||
|
/*
|
||||||
|
save();
|
||||||
|
save(String saveDirPath, boolean overwrite);
|
||||||
|
saveAs(String saveDirPath, String fileName);
|
||||||
|
saveAs(String saveDirPath, String fileName, boolean overwrite);
|
||||||
|
*/
|
||||||
|
|
||||||
|
// FileItem 객체로 아래와 같은 정보를 가져올 수 있습니다. 추가적으로 필요한 정보가 있을 경우 JSONObject 객체에 추가해 주십시오.
|
||||||
|
// 교환할 데이터는 JSON 타입이 아니어도 되며, Javascript에서 파싱할 적절한 형태로 조합하시면 됩니다.
|
||||||
|
// LastSavedDirectoryPath, LastSavedFileName에는 Windwos 경로에 대한 예외처리가 되어 있습니다. 서버 환경에 맞게 적절히 수정해 주십시오.
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("name", fileItem.getName());
|
||||||
|
jsonObject.put("fileName", fileItem.getFileName());
|
||||||
|
jsonObject.put("lastSavedDirectoryPath", fileItem.getLastSavedDirPath().replaceAll("\\\\", "/"));
|
||||||
|
jsonObject.put("lastSavedFilePath", fileItem.getLastSavedFilePath().replaceAll("\\\\", "/"));
|
||||||
|
jsonObject.put("lastSavedFileName", fileItem.getLastSavedFileName());
|
||||||
|
jsonObject.put("fileSize", Long.toString(fileItem.getFileSize()));
|
||||||
|
jsonObject.put("fileNameWithoutFileExt", fileItem.getFileNameWithoutFileExt());
|
||||||
|
jsonObject.put("fileExtension", fileItem.getFileExtension());
|
||||||
|
jsonObject.put("contentType", fileItem.getContentType());
|
||||||
|
jsonObject.put("isSaved", Boolean.toString(fileItem.isSaved()));
|
||||||
|
jsonObject.put("isEmptyFile", Boolean.toString(fileItem.isEmptyFile()));
|
||||||
|
|
||||||
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
jsonObject.writeJSONString(stringWriter);
|
||||||
|
writer.println(jsonObject.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(CrossUploaderException ex) {
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
// 업로드 외 로직에서 예외 발생시 업로드 중인 모든 파일을 삭제합니다.
|
||||||
|
fileUpload.deleteUploadedFiles();
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// 파일 업로드 객체에서 사용한 자원을 해제합니다.
|
||||||
|
fileUpload.clear();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
request.setCharacterEncoding("UTF-8");
|
||||||
|
PrintWriter writer = response.getWriter();
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlHeader(writer);
|
||||||
|
|
||||||
|
try {
|
||||||
|
/**
|
||||||
|
* 업로드 된 파일 정보를 처리합니다.
|
||||||
|
* 샘플에서는 JSON 타입으로 데이터를 교환하고 있습니다. 필요 시 다른 형식으로 조합해서 사용하실 수 있습니다.
|
||||||
|
*/
|
||||||
|
String uploadedFilesInfo = request.getParameter("uploadedFilesInfo");
|
||||||
|
if(uploadedFilesInfo != null) {
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(uploadedFilesInfo);
|
||||||
|
JSONArray jsonArray = (JSONArray)obj;
|
||||||
|
for(int i=0; i<jsonArray.size(); i++) {
|
||||||
|
//JSONObject jsonObject = (JSONObject)jsonArray.get(i);
|
||||||
|
/**
|
||||||
|
* UploadProcess.jsp에서 보낸 정보입니다.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
String name = (String)jsonObject.get("name");
|
||||||
|
String fileName = (String)jsonObject.get("fileName");
|
||||||
|
String lastSavedDirectoryPath = (String)jsonObject.get("lastSavedDirectoryPath");
|
||||||
|
String lastSavedFilePath = (String)jsonObject.get("lastSavedFilePath");
|
||||||
|
String lastSavedFileName = (String)jsonObject.get("lastSavedFileName");
|
||||||
|
String fileSize = (String)jsonObject.get("fileSize");
|
||||||
|
String fileNameWithoutFileExt = (String)jsonObject.get("fileNameWithoutFileExt");
|
||||||
|
String fileExtension = (String)jsonObject.get("fileExtension");
|
||||||
|
String contentType = (String)jsonObject.get("contentType");
|
||||||
|
String isSaved = (String)jsonObject.get("isSaved");
|
||||||
|
String isEmptyFile = (String)jsonObject.get("isEmptyFile");
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
// 업로드 정보 출력
|
||||||
|
printFileUploadResult(obj, writer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ParseException ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlFooter(writer);
|
||||||
|
}
|
||||||
|
%><%!
|
||||||
|
public void printFileUploadResult(Object obj, PrintWriter writer) {
|
||||||
|
if(obj == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String html = "";
|
||||||
|
JSONArray jsonArray = (JSONArray)obj;
|
||||||
|
for(int i=0; i<jsonArray.size(); i++) {
|
||||||
|
JSONObject jsonObject = (JSONObject)jsonArray.get(i);
|
||||||
|
html += "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>" + (i+1) + "번째 파일 업로드 정보</b></td><tr>";
|
||||||
|
html += "<tr><td>Name</td><td>" + (String)jsonObject.get("name") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Name</td><td>" + (String)jsonObject.get("fileName") + "</td></tr>";
|
||||||
|
html += "<tr><td>Last Saved Directory Path</td><td>" + (String)jsonObject.get("lastSavedDirectoryPath") + "</td></tr>";
|
||||||
|
html += "<tr><td>Last Saved File Path</td><td>" + (String)jsonObject.get("lastSavedFilePath") + "</td></tr>";
|
||||||
|
html += "<tr><td>Last Saved File Name</td><td>" + (String)jsonObject.get("lastSavedFileName") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Size</td><td>" + (String)jsonObject.get("fileSize") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Name without File Ext</td><td>" + (String)jsonObject.get("fileNameWithoutFileExt") + "</td></tr>";
|
||||||
|
html += "<tr><td>File Extension</td><td>" + (String)jsonObject.get("fileExtension") + "</td></tr>";
|
||||||
|
html += "<tr><td>Content Type</td><td>" + (String)jsonObject.get("contentType") + "</td></tr>";
|
||||||
|
html += "<tr><td>Is Saved</td><td>" + (String)jsonObject.get("isSaved") + "</td></tr>";
|
||||||
|
html += "<tr><td>Is EmptyFile</td><td>" + (String)jsonObject.get("isEmptyFile") + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
}
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void printExceptionMessage(String message, PrintWriter writer) {
|
||||||
|
String html = "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>예외가 발생했습니다.</b></td><tr>";
|
||||||
|
html += "<tr><td>예외 메시지: </td><td>" + message + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlHeader(PrintWriter writer) {
|
||||||
|
String html = "<html><head>";
|
||||||
|
html += "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";
|
||||||
|
html += "<link rel='stylesheet' type='text/css' href='../../css/common.css'/>";
|
||||||
|
html += "<title>파일 업로드 정보입니다</title></head>";
|
||||||
|
html += "<body>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlFooter(PrintWriter writer) {
|
||||||
|
writer.println("</body></html>");
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="org.json.simple.JSONArray"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
<%@page import="org.json.simple.parser.JSONParser"%>
|
||||||
|
<%@page import="org.json.simple.parser.ParseException"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
request.setCharacterEncoding("UTF-8");
|
||||||
|
PrintWriter writer = response.getWriter();
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlHeader(writer);
|
||||||
|
|
||||||
|
try {
|
||||||
|
/**
|
||||||
|
* 기존에 업로드 된 정보를 삭제합니다.
|
||||||
|
* 샘플에서는 JSON 타입으로 데이터를 교환하고 있습니다. 필요 시 다른 형식으로 조합해서 사용하실 수 있습니다.
|
||||||
|
*/
|
||||||
|
String uploadedFilesInfo = request.getParameter("uploadedFilesInfo");
|
||||||
|
String osName = System.getProperty("os.name");
|
||||||
|
if(uploadedFilesInfo != null) {
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
Object obj = jsonParser.parse(uploadedFilesInfo);
|
||||||
|
JSONArray jsonArray = (JSONArray)obj;
|
||||||
|
for(int i=0; i<jsonArray.size(); i++) {
|
||||||
|
JSONObject jsonObject = (JSONObject)jsonArray.get(i);
|
||||||
|
/**
|
||||||
|
* UploadProcess.jsp에서 보낸 정보입니다.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
String name = (String)jsonObject.get("name");
|
||||||
|
String fileName = (String)jsonObject.get("fileName");
|
||||||
|
String lastSavedDirectoryPath = (String)jsonObject.get("lastSavedDirectoryPath");
|
||||||
|
String lastSavedFilePath = (String)jsonObject.get("lastSavedFilePath");
|
||||||
|
String lastSavedFileName = (String)jsonObject.get("lastSavedFileName");
|
||||||
|
String fileSize = (String)jsonObject.get("fileSize");
|
||||||
|
String fileNameWithoutFileExt = (String)jsonObject.get("fileNameWithoutFileExt");
|
||||||
|
String fileExtension = (String)jsonObject.get("fileExtension");
|
||||||
|
String contentType = (String)jsonObject.get("contentType");
|
||||||
|
String isSaved = (String)jsonObject.get("isSaved");
|
||||||
|
String isEmptyFile = (String)jsonObject.get("isEmptyFile");
|
||||||
|
*/
|
||||||
|
String lastSavedFilePath = (String)jsonObject.get("lastSavedFilePath");
|
||||||
|
if(lastSavedFilePath != null) {
|
||||||
|
File delFile = new File(lastSavedFilePath);
|
||||||
|
if(delFile.exists() && delFile.isFile()) {
|
||||||
|
delFile.delete();
|
||||||
|
// 삭제된 파일 정보 출력
|
||||||
|
printDeletedFilesInfo(lastSavedFilePath, writer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ParseException ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
printExceptionMessage(ex.getMessage(), writer);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// 업로드 정보를 화면에 출력하기 위한 HTML 코드입니다. 신경쓰지 않으셔도 됩니다.
|
||||||
|
printHtmlFooter(writer);
|
||||||
|
}
|
||||||
|
%><%!
|
||||||
|
public void printDeletedFilesInfo(String delFile, PrintWriter writer) {
|
||||||
|
if(delFile == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String html = "";
|
||||||
|
html += "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>삭제된 파일 정보</b></td><tr>";
|
||||||
|
html += "<tr><td>Deleted File</td><td>" + delFile + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printExceptionMessage(String message, PrintWriter writer) {
|
||||||
|
String html = "<div class='form_area'><table class='form_table'><tbody>";
|
||||||
|
html += "<tr><td class='form_table_title' colspan=2><b>예외가 발생했습니다.</b></td><tr>";
|
||||||
|
html += "<tr><td>예외 메시지: </td><td>" + message + "</td></tr>";
|
||||||
|
html += "</tbody></table></div>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlHeader(PrintWriter writer) {
|
||||||
|
String html = "<html><head>";
|
||||||
|
html += "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";
|
||||||
|
html += "<link rel='stylesheet' type='text/css' href='../../css/common.css'/>";
|
||||||
|
html += "<title>파일 업로드 정보입니다</title></head>";
|
||||||
|
html += "<body>";
|
||||||
|
|
||||||
|
writer.println(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printHtmlFooter(PrintWriter writer) {
|
||||||
|
writer.println("</body></html>");
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
@ -0,0 +1,327 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>파일 업로드 UI를 설정하는 예제입니다.</title>
|
||||||
|
|
||||||
|
<!-- 샘플 설명을 위한 화면 스타일입니다. 중요하지 않으며, 필요 없을 시 삭제해 주십시오. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
|
||||||
|
|
||||||
|
<!-- NamoCrossUploader Client HTML5 Edition 이 동작하기 위한 필수 파일입니다. -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/slick.grid.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/smoothness/jquery-ui-1.8.16.custom.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/slick/css/theme.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/css/namocrossuploader.css" />
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery-1.11.3.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/jquery.event.drag-2.2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.grid.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/slick.dataview.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.checkboxselectcolumn.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/slick/plugins/slick.rowselectionmodel.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader-config.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/js/namocrossuploader.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.contextMenu.js"></script>
|
||||||
|
<script type="text/javascript" src="../../app/lib/contextmenu/jquery.ui.position.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../app/lib/contextmenu/jquery.contextMenu.css" />
|
||||||
|
<!-- -->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="content_title_area">
|
||||||
|
<div class="content_title">샘플 설명</div>
|
||||||
|
<div class="content_desc">파일 업로드 UI를 설정하는 예제입니다.<br /><font color="red">UI 설정 가이드를 위해 코드가 다소 복잡하니 실제 업로드, 다운로드 기능은 해당 샘플을 참고해 주십시오.</font></div>
|
||||||
|
<div class="content_title">샘플 경로</div>
|
||||||
|
<div class="content_desc">Samples/SettingUI/SettingFileUploadUI</div>
|
||||||
|
</div><br />
|
||||||
|
|
||||||
|
<!-- UI 설정 값 -->
|
||||||
|
<div class="ui_area">
|
||||||
|
<input type="button" value="UI 스타일 변경" onclick="resetUiProperties()" /> (아래 표에서 변경할 UI 스타일을 설정해 주십시오.)<br />
|
||||||
|
<table class="ui_table">
|
||||||
|
<tbody>
|
||||||
|
<tr class="ui_table_title">
|
||||||
|
<td width="200">항목</td>
|
||||||
|
<td width="80">초기 값</td>
|
||||||
|
<td width="100">변경할 값</td>
|
||||||
|
<td width="800">설명</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>크기 변경</td>
|
||||||
|
<td>가로: 436<br />세로: 280</td>
|
||||||
|
<td>가로: <input type="text" id="mainWidth" value="436" size="5" /><br />세로: <input type="text" id="mainHeight" value="280" size="5" /></td>
|
||||||
|
<td>최초 크기를 지정할 경우 createUploader 메소드의 파라미터를 사용하고, 이후 동적으로 크기를 변경할 경우는 setUiProperties 메소드의 파라미터를 사용해 주십시오.
|
||||||
|
<br /><font color="red">"가로, 세로 각각 %, px를 함께 입력할 수 있으며, 입력하지 않을 경우 px 단위로 동작합니다."</font></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>메인 보더 컬러 변경</td>
|
||||||
|
<td>#EEEEEE</td>
|
||||||
|
<td><input type="text" id="mainBorderColor" value="#EEEEEE" size="9" /></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>상단(버튼) 패널 display 상태 변경</td>
|
||||||
|
<td>block</td>
|
||||||
|
<td><input type="radio" name="topPanelDisplayStyle" checked="checked" />block<br />
|
||||||
|
<input type="radio" name="topPanelDisplayStyle" />none</td>
|
||||||
|
<td>상단 패널 display 상태가 none일 경우, selectFiles, startUpload 메소드를 사용해 주십시오.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>파일선택 버튼의 display 상태 변경</td>
|
||||||
|
<td>block</td>
|
||||||
|
<td><input type="radio" name="selectFilesButtonDisplayStyle" checked="checked" />block<br />
|
||||||
|
<input type="radio" name="selectFilesButtonDisplayStyle" />none</td>
|
||||||
|
<td>파일선택 버튼의 display 상태가 none일 경우, selectFiles 메소드를 사용해 주십시오.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>파일선택 버튼의 disabled 상태 변경</td>
|
||||||
|
<td>false</td>
|
||||||
|
<td><input type="radio" name="selectFilesButtonDisabledStyle" />true<br />
|
||||||
|
<input type="radio" name="selectFilesButtonDisabledStyle" checked="checked" />false</td>
|
||||||
|
<td>파일선택 버튼의 disabled 상태가 true일 경우, selectFiles 메소드를 사용해 주십시오.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>업로드 버튼의 display 상태 변경</td>
|
||||||
|
<td>block</td>
|
||||||
|
<td><input type="radio" name="uploadButtonDisplayStyle" checked="checked" />block<br />
|
||||||
|
<input type="radio" name="uploadButtonDisplayStyle" />none</td>
|
||||||
|
<td>업로드 버튼의 display 상태가 none일 경우, startUpload 메소드를 사용해 주십시오.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>업로드 버튼의 disabled 상태 변경</td>
|
||||||
|
<td>false</td>
|
||||||
|
<td><input type="radio" name="uploadButtonDisabledStyle" />true<br />
|
||||||
|
<input type="radio" name="uploadButtonDisabledStyle" checked="checked" />false</td>
|
||||||
|
<td>업로드 버튼의 disabled 상태가 true일 경우, startUpload 메소드를 사용해 주십시오.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>상태바 파일선택 버튼 display 상태 변경</td>
|
||||||
|
<td>false</td>
|
||||||
|
<td>
|
||||||
|
<input type="radio" name="selectFilesButtonDisplayStyleOnStatus" />true<br />
|
||||||
|
<input type="radio" name="selectFilesButtonDisplayStyleOnStatus" checked="checked" />false
|
||||||
|
</td>
|
||||||
|
<td>상단 패널 파일선택 버튼의 display 상태가 none일 경우, 상태바 파일선택 버튼 또는 selectFiles 메소드를 사용해 주십시오.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>전송 완료 후 모니터 창 닫기 체크박스 설정</td>
|
||||||
|
<td>true</td>
|
||||||
|
<td><input type="radio" name="closeMonitorCheckBoxChecked" value="true" checked="checked" />true<br /><input type="radio" name="closeMonitorCheckBoxChecked" value="false" />false</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div id="uploaderContainer" class="form_area">
|
||||||
|
<form name="dataForm" method="post" action="DataProcess.jsp">
|
||||||
|
<!-- 파일 정보를 저장할 폼 데이터 -->
|
||||||
|
<input type="hidden" name="uploadedFilesInfo" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossUploader Event를 설정합니다.
|
||||||
|
* 아래의 Event 이름들은 namocrossuploader-config.js 파일에서 변경하실 수 있습니다.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 업로드 시작 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onStartUploadCu = function () {
|
||||||
|
//alert('onStartUploadCu : 업로드가 시작됐습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 시작 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onStartUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert("[" + rowIndex + "번째 파일의 정보]\n" +
|
||||||
|
"FileType : " + obj.fileType + " (NORMAL:파일, UPLOADED:업로드된 파일)\n" +
|
||||||
|
"FileId : " + obj.fileId + "\n" +
|
||||||
|
"FileName : " + obj.fileName + "\n" +
|
||||||
|
"FileSize : " + obj.fileSize + "\n" +
|
||||||
|
"Status : " + obj.status + "\n" +
|
||||||
|
"IsDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"FileType, FileId, IsDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 완료 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onEndUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert("[" + rowIndex + "번째 파일의 정보]\n" +
|
||||||
|
"FileType : " + obj.fileType + " (NORMAL:파일, UPLOADED:업로드된 파일)\n" +
|
||||||
|
"FileId : " + obj.fileId + "\n" +
|
||||||
|
"FileName : " + obj.fileName + "\n" +
|
||||||
|
"FileSize : " + obj.fileSize + "\n" +
|
||||||
|
"Status : " + obj.status + "\n" +
|
||||||
|
"IsDeleted : " + obj.isDeleted + "\n\n" +
|
||||||
|
"FileType, FileId, IsDeleted 게시판 수정모드에 활용되는 속성입니다."
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 업로드 완료 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onEndUploadCu = function () {
|
||||||
|
// alert('업로드가 완료됐습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전송창이 닫힐 때 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onCloseMonitorWindowCu = function () {
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
// onEndUploadCu 나 onCloseMonitorWindowCu 이벤트 시점에 처리하시면 되며,
|
||||||
|
// onCloseMonitorWindowCu 시에는 getUploadStatus()를 호출하여 업로드 완료되어 있는지 체크해 주십시오.
|
||||||
|
if (uploader.getUploadStatus() == 'COMPLETION') {
|
||||||
|
|
||||||
|
// 업로드된 전체 파일의 정보를 가져옵니다.
|
||||||
|
var uploadedFilesInfo = uploader.getUploadedFilesInfo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 필요 시, 아래처럼 사용해 주십시오. (JSON으로 넘오올 경우)
|
||||||
|
var obj = jQuery.parseJSON(uploadedFilesInfo);
|
||||||
|
alertTimeout(obj.length);
|
||||||
|
alertTimeout(obj[0].name);
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 데이터 처리 페이지로 업로드 결과를 전송합니다.
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 개별 파일에 대한 업로드 취소 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onCancelUploadItemCu = function (rowIndex) {
|
||||||
|
/*
|
||||||
|
var obj = jQuery.parseJSON(uploader.getFileInfoAt(rowIndex));
|
||||||
|
alert('[개별 파일에 대한 업로드 취소 정보]\n' +
|
||||||
|
'FileName : ' + obj.fileName + '\n' +
|
||||||
|
'FileSize : ' + obj.fileSize + '\n'
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 예외 발생 시 호출됩니다.
|
||||||
|
*/
|
||||||
|
var onExceptionCu = function () {
|
||||||
|
// 300~ : 일반적 예외
|
||||||
|
// 400~ : 시스템 예외
|
||||||
|
// 500~ : 서측에서 발생한 예외
|
||||||
|
// 필요한 예외정보만 고객에서 보여주십시오.
|
||||||
|
var exceptionInfo = uploader.getLastExceptionInfo();
|
||||||
|
var obj = jQuery.parseJSON(exceptionInfo);
|
||||||
|
alert('[예외 정보]\n' + 'code : ' + obj.code + '\n' + 'message : ' + obj.message + '\n' + 'detailMessage : ' + obj.detailMessage);
|
||||||
|
|
||||||
|
if (parseInt(obj.code, 10) > 400000) {
|
||||||
|
var uploadedFilesInfo = uploader.getUploadedFilesInfo();
|
||||||
|
document.dataForm.uploadedFilesInfo.value = uploadedFilesInfo;
|
||||||
|
document.dataForm.action = "ErrorProcess.jsp";
|
||||||
|
document.dataForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UI Properties 변경
|
||||||
|
*/
|
||||||
|
var resetUiProperties = function () {
|
||||||
|
var mainWidth = document.getElementById('mainWidth').value;
|
||||||
|
var mainHeight = document.getElementById('mainHeight').value;
|
||||||
|
var mainBorderColor = document.getElementById('mainBorderColor').value;
|
||||||
|
var topPanelDisplayStyle = (document.getElementsByName('topPanelDisplayStyle')[0].checked == true) ? 'block' : 'none';
|
||||||
|
var selectFilesButtonDisplayStyle = (document.getElementsByName('selectFilesButtonDisplayStyle')[0].checked == true) ? 'block' : 'none';
|
||||||
|
var selectFilesButtonDisabledStyle = (document.getElementsByName('selectFilesButtonDisabledStyle')[0].checked == true) ? true : false;
|
||||||
|
var uploadButtonDisplayStyle = (document.getElementsByName('uploadButtonDisplayStyle')[0].checked == true) ? 'block' : 'none';
|
||||||
|
var uploadButtonDisabledStyle = (document.getElementsByName('uploadButtonDisabledStyle')[0].checked == true) ? true : false;
|
||||||
|
var selectFilesButtonDisplayStyleOnStatus = (document.getElementsByName('selectFilesButtonDisplayStyleOnStatus')[0].checked == true) ? 'block' : 'none';
|
||||||
|
var closeMonitorCheckBoxChecked = (document.getElementsByName('closeMonitorCheckBoxChecked')[0].checked == true) ? true : false;
|
||||||
|
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = mainWidth; // FileUploadManager 너비
|
||||||
|
managerProperties.height = mainHeight; // FileUploadManager 높이
|
||||||
|
managerProperties.borderColor = mainBorderColor; // FileUploadManager 보더 컬러
|
||||||
|
managerProperties.topPanelDisplayStyle = topPanelDisplayStyle; // 상단 패널 Visible 상태
|
||||||
|
managerProperties.selectFilesButtonDisplayStyle = selectFilesButtonDisplayStyle; // 파일선택 버튼 Visible 상태
|
||||||
|
managerProperties.selectFilesButtonDisabledStyle = selectFilesButtonDisabledStyle; // 파일선택 버튼 Enabled 상태
|
||||||
|
managerProperties.uploadButtonDisplayStyle = uploadButtonDisplayStyle; // 업로드 버튼 Visible 상태
|
||||||
|
managerProperties.uploadButtonDisabledStyle = uploadButtonDisabledStyle; // 업로드 버튼 Enabled 상태
|
||||||
|
managerProperties.selectFilesButtonDisplayStyleOnStatus = selectFilesButtonDisplayStyleOnStatus; // 상태바 파일선택 버튼 Visible 상태
|
||||||
|
|
||||||
|
var monitorProperties = new Object();
|
||||||
|
monitorProperties.closeMonitorCheckBoxChecked = closeMonitorCheckBoxChecked; // 전송 완료 후 FileUploadMonitor 창 닫기 설정
|
||||||
|
|
||||||
|
namoCrossUploader.setUploaderProperties(
|
||||||
|
JSON.stringify(managerProperties), // FileUploadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(monitorProperties)); // FileUploadMonitor 프로퍼티를 JSON 문자열로 전달
|
||||||
|
|
||||||
|
|
||||||
|
// 상단 패널, 또는 버튼의 visible, enabled 상태에 따라 html 버튼의 visibility 설정
|
||||||
|
document.getElementById("selectFiles").disabled = true;
|
||||||
|
document.getElementById("startUpload").disabled = true;
|
||||||
|
|
||||||
|
if (topPanelDisplayStyle == 'none') {
|
||||||
|
document.getElementById("selectFiles").disabled = false;
|
||||||
|
document.getElementById("startUpload").disabled = false;
|
||||||
|
}
|
||||||
|
else if (selectFilesButtonDisplayStyle == 'none' || selectFilesButtonDisabledStyle == true)
|
||||||
|
document.getElementById("selectFiles").disabled = false;
|
||||||
|
else if (uploadButtonDisplayStyle == 'none' || uploadButtonDisabledStyle == true)
|
||||||
|
document.getElementById("startUpload").disabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NamoCrossUploader 객체를 생성합니다.
|
||||||
|
*/
|
||||||
|
var namoCrossUploader = new __NamoCrossUploader();
|
||||||
|
var uploadUrl = window.namoCrossUploaderConfig.productPath + 'SettingUI/SettingFileUploadUI/UploadProcess.jsp';
|
||||||
|
var managerProperties = new Object();
|
||||||
|
managerProperties.width = '436'; // FileUploadManager 너비
|
||||||
|
managerProperties.height = '280'; // FileUploadManager 높이
|
||||||
|
managerProperties.containerId = 'uploaderContainer';// FileUploadManager 객체가 생성될 html div 태그 id
|
||||||
|
managerProperties.uploadUrl = uploadUrl; // 파일 업로드 처리 페이지 경로
|
||||||
|
|
||||||
|
var monitorProperties = new Object();
|
||||||
|
monitorProperties.monitorLayerClass = 'monitorLayer'; // FileUploadMonitor 창의 스타일입니다. (namocrossuploader.css 파일에 정의, 변경 가능)
|
||||||
|
monitorProperties.monitorBgLayerClass = 'monitorBgLayer'; // FileUploadMonitor 창의 백그라운드 스타일입니다. (namocrossuploader.css 파일에 정의, 변경 가능)
|
||||||
|
monitorProperties.closeMonitorCheckBoxChecked = true; // 전송 완료 후 FileUploadMonitor 창 닫기 설정
|
||||||
|
|
||||||
|
var uploader = namoCrossUploader.createUploader(
|
||||||
|
JSON.stringify(managerProperties), // FileUploadManager 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(monitorProperties), // FileUploadMonitor 프로퍼티를 JSON 문자열로 전달
|
||||||
|
JSON.stringify(window.namoCrossUploaderConfig.eventNames)); // 이벤트 이름을 JSON 문자열로 전달
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 사용자 정의 파일추가
|
||||||
|
*/
|
||||||
|
var onSelectFiles = function () {
|
||||||
|
uploader.selectFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 사용자 정의 업로드
|
||||||
|
*/
|
||||||
|
var onStartUpload = function () {
|
||||||
|
uploader.startUpload();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<br />
|
||||||
|
<div>
|
||||||
|
<input type="button" id="selectFiles" value="파일추가" onclick="onSelectFiles()" disabled />
|
||||||
|
<input type="button" id="startUpload" value="업로드" onclick="onStartUpload()" disabled />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@page import="com.namo.crossuploader.*"%>
|
||||||
|
<%@page import="java.io.*"%>
|
||||||
|
<%@page import="org.json.simple.JSONObject"%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
PrintWriter writer = response.getWriter();
|
||||||
|
FileUpload fileUpload = new FileUpload(request, response);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// autoMakeDirs를 true로 설정하면 파일 저장 및 이동시 파일생성에 필요한 상위 디렉토리를 모두 생성합니다.
|
||||||
|
fileUpload.setAutoMakeDirs(true);
|
||||||
|
|
||||||
|
// 파일을 저장할 경로를 설정합니다.
|
||||||
|
String saveDirPath = request.getRealPath("/");
|
||||||
|
saveDirPath += ("UploadDir" + File.separator);
|
||||||
|
|
||||||
|
// saveDirPath에 지정한 경로로 파일 업로드를 시작합니다.
|
||||||
|
fileUpload.startUpload(saveDirPath);
|
||||||
|
|
||||||
|
// 업로드 경로를 지정하지 않을 경우, 시스템의 임시 디렉토리로 파일 업로드를 시작합니다.
|
||||||
|
// fileUpload.startUpload();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 입력한 file 태그의 name을 키로 갖는 FileItem[] 객체를 리턴합니다.
|
||||||
|
* NamoCrossUploader Client Flex Edition의 name은 "CU_FILE" 입니다.
|
||||||
|
*/
|
||||||
|
FileItem fileItem = fileUpload.getFileItem("CU_FILE");
|
||||||
|
|
||||||
|
if(fileItem != null) {
|
||||||
|
// saveDirPath 경로에 원본 파일명으로 저장(이동)합니다. 동일한 파일명이 존재할 경우 다른 이름으로 저장됩니다.
|
||||||
|
fileItem.save(saveDirPath);
|
||||||
|
|
||||||
|
// 다른 유형의 저장(이동) 함수들
|
||||||
|
/*
|
||||||
|
save();
|
||||||
|
save(String saveDirPath, boolean overwrite);
|
||||||
|
saveAs(String saveDirPath, String fileName);
|
||||||
|
saveAs(String saveDirPath, String fileName, boolean overwrite);
|
||||||
|
*/
|
||||||
|
|
||||||
|
// FileItem 객체로 아래와 같은 정보를 가져올 수 있습니다. 추가적으로 필요한 정보가 있을 경우 JSONObject 객체에 추가해 주십시오.
|
||||||
|
// 교환할 데이터는 JSON 타입이 아니어도 되며, Javascript에서 파싱할 적절한 형태로 조합하시면 됩니다.
|
||||||
|
// LastSavedDirectoryPath, LastSavedFileName에는 Windwos 경로에 대한 예외처리가 되어 있습니다. 서버 환경에 맞게 적절히 수정해 주십시오.
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("name", fileItem.getName());
|
||||||
|
jsonObject.put("fileName", fileItem.getFileName());
|
||||||
|
jsonObject.put("lastSavedDirectoryPath", fileItem.getLastSavedDirPath().replaceAll("\\\\", "/"));
|
||||||
|
jsonObject.put("lastSavedFilePath", fileItem.getLastSavedFilePath().replaceAll("\\\\", "/"));
|
||||||
|
jsonObject.put("lastSavedFileName", fileItem.getLastSavedFileName());
|
||||||
|
jsonObject.put("fileSize", Long.toString(fileItem.getFileSize()));
|
||||||
|
jsonObject.put("fileNameWithoutFileExt", fileItem.getFileNameWithoutFileExt());
|
||||||
|
jsonObject.put("fileExtension", fileItem.getFileExtension());
|
||||||
|
jsonObject.put("contentType", fileItem.getContentType());
|
||||||
|
jsonObject.put("isSaved", Boolean.toString(fileItem.isSaved()));
|
||||||
|
jsonObject.put("isEmptyFile", Boolean.toString(fileItem.isEmptyFile()));
|
||||||
|
|
||||||
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
jsonObject.writeJSONString(stringWriter);
|
||||||
|
writer.println(jsonObject.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(CrossUploaderException ex) {
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
// 업로드 외 로직에서 예외 발생시 업로드 중인 모든 파일을 삭제합니다.
|
||||||
|
fileUpload.deleteUploadedFiles();
|
||||||
|
response.setStatus(response.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// 파일 업로드 객체에서 사용한 자원을 해제합니다.
|
||||||
|
fileUpload.clear();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||