Double quotes in onSuccessItem response #643

Open
opened 2017-02-24 15:32:03 +00:00 by RadouaneRoufid · 1 comment
RadouaneRoufid commented 2017-02-24 15:32:03 +00:00 (Migrated from github.com)

Hi,

I use you wonderful api to upload files to my backend server that sends me back the stored file name.

I use onSuccessItem to retrieve this name, I found that it's enclosed by double quotes.

Example :

Server side :

	@PostMapping
	public ResponseEntity<String> handleFileUpload(@RequestParam("file") MultipartFile file) {
		String filename = fileSystemStorageService.store(file);

		System.out.println(filename);

		return ResponseEntity.ok().body(filename); // <-- 6cb0523a-5f42-41c6-a1d2-54bd3214335e
	}

Client side :

        this.uploader.onSuccessItem = ((item: FileItem, response: string, status: number, headers: ParsedResponseHeaders): any => {          

            console.log("response " + response); // <-- response "6cb0523a-5f42-41c6-a1d2-54bd3214335e"
        });

Is there any direct way to get the response without double quotes ?

Thank you !

Hi, I use you wonderful api to upload files to my backend server that sends me back the stored file name. I use `onSuccessItem `to retrieve this name, I found that it's enclosed by double quotes. Example : Server side : ``` @PostMapping public ResponseEntity<String> handleFileUpload(@RequestParam("file") MultipartFile file) { String filename = fileSystemStorageService.store(file); System.out.println(filename); return ResponseEntity.ok().body(filename); // <-- 6cb0523a-5f42-41c6-a1d2-54bd3214335e } ``` Client side : ``` this.uploader.onSuccessItem = ((item: FileItem, response: string, status: number, headers: ParsedResponseHeaders): any => { console.log("response " + response); // <-- response "6cb0523a-5f42-41c6-a1d2-54bd3214335e" }); ``` Is there any direct way to get the response without double quotes ? Thank you !
NeelBhatt commented 2018-10-29 13:55:30 +00:00 (Migrated from github.com)

I am facing the same problem. Any solution for this?

I am facing the same problem. Any solution for this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#643