English 中文(简体)
Upload pdf on a services with Spring MVC
原标题:Upload pdf on a server with Spring MVC

i 努力建立一个网站,让用户选择上载一个pdf文档。 我想,在服务器上用特别的舱面挽救这一pdf。 例如:

用户选择标题。

用户上载文档。

在采取这些行动之后,我想通过一个特定的url/名_用户_give查阅档案。

I saw that the Spring MVC provides very easy interface for file uploading.I already see many tutorial about this but my problem is how can i save the paper into a server.Also i want the pdf to open by the browser s tools.Can anyone give me directions?

最佳回答

To save the file on server path you simply needs to write the file stream to the path described by

request.getServletContext().getRealPath("your directory name here");

然后使用你获得的真正途径创建档案。

And to show the pdf file using browser plugin, you should use following in your controller method.

@RequestMapping(value="url to map", produces={"application/pdf"})

希望能帮助你们。

乘客。

问题回答

暂无回答




相关问题
How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Extract everything from PDF [closed]

Looking for solution to extract content from a PDF file (using console tool or a library). It will be used on server to produce on-line e-books from uploaded PDF files. Need to extract following ...

PDF compression How does Adobe do it?

This is a bit more of a fun question than a serious one, but how does the Adobe PDF format make documents so... portable? I just created a small Word document, 235kb in size, containing multiple ...

Exporting HTML Tables

How can I export an HTML table in my page as PDF and/or XLS? (preferably using JS (+jquery))

Using Java PDFBox library to write Russian PDF

I am using a Java library called PDFBox trying to write text to a PDF. It works perfect for English text, but when i tried to write Russian text inside the PDF the letters appeared so strange. It ...

HTML --> PDF with PHP [duplicate]

Possible Duplicate: Convert HTML + CSS to PDF with PHP? How can I convert an HTML page (via $cURL or something) to a PDF file?

Free way to convert PDF to XPS with C#

Are there any free tools that I can use to convert a PDF document into an XPS document? Although a nice programmatic API would be nice, I m not opposed to shelling out to a command line tool to do ...

PDF conversion service

I need to develop a service able to convert MS Office and Open Office documents to PDF. And the PDF`s also need to be commentable when opened in ADOBE Reader. I have used a piece of software from www....

热门标签