简体   繁体   中英

Servlet download File from remote Server

I need to create a Servlet which offers files from an external Server and sends it to the user.

www.downloadServiceUrl.com/download/path-to-external-stored-file

as I don't want the servlet to be a "man in the middle", I need it to serve the file without pretransferring it to itself and then resubmitting it to the user for performance-issues (otherwise each download takes at least 2 times as long as it needs - not speaking about speed bottlenecks between these servers.

Is this possible anyhow?

Thanks!

The only way I think this could be done is if your java process can access the file system where your files reside. Your webapp can only serve files in its context, not outside, thus you need to access the file system of the external server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM