My requirement is:
User will upload a .zip file (which will contain multiple files) via API and I need to send back the files to the user in response.
My solution 1:
returning list of the file download link to user in response.
but the user is not happy with this solution.
Is there any other way return the list of file?
Alternative solution would be to unzip your archive directly in browser using a library like zip.js or similar.
Related
I know solution of the above problem using HTML form in which user chooses a file from computer and upload it and then download it but how to do it without using HTML with the already given path of file.
Thank you For your concern in Advance.
I assume the scenario is that the user accesses your server from a browser.
In this case you will not be able to access the file system given file paths. Only the user can grant access to certain files by selecting them in a file upload input.
If the user uses a mobile/desktop application that sends the file to your server, you must implement the upload in the app itself.
Hi I am trying to get the full file path of a file that I uploaded in Spring. I am able to get file name by using bean.getFile().getOriginalFilename(). But this gives just the file name like abc.csv.
I tried searching answer for this in several forums and I am not finding proper way of retrieving file path information.
Modern browsers do not send full path info for file uploads. They only send the short file name. There's no way to retrieve it if the client doesn't send it.
I would like to know if it's possible to download a file from a servlet and directly save it in a specific directory on the client (without asking the user to select a directory where to save the file, without prompting anything actually)?
No, That will break the security, by the way how would server know about the client file system ?
I am new to domino.
I trying to handle a file upload request in Java agent of domino.
I assumed that it should be an embedded object in document context, but it is NOT there.
I don't know any other way, Is there a way to get the file which is sent as a post request? How does the domino handles it.
thanks
The simple solution to uploading files is just to create a Form containing a FileUpload field and then move or process the file in the QuerySave agent. Don't think you can upload files to and web agent.
Good links:
How To: Upload Files To Domino From Flex
Adding Your Own File Uploads to Forms
/Not soo much newb anymore
Most likely the attachment is embedded into a RichText element in the document. To access it, iterate through the document.items and find an item of type RICHTEXT. Then you can check it for embedded objects.
There is a useful domino object map located here
/Newbs
HI...
Currently I m working in a application in which application allows to access directory (which contains some files) from file server to Application (client).
I tried following code..
URL url=("http://192.168.5.555/file-server/user/images/");
URI uri=url.toURI();
File list[];
list= new File(uri).listFiles();
But its thrown java.lang.IllegalArgumentException Exception.
I don't know how this happen?
I simply access images directory from the given URL (file server).
Help me...
That isn't going to work. The java.io.File operates on the local disk file system only, i.e. on URI's starting with file:// only. It would otherwise indeed going to be too easy to leech files from places where you aren't allowed to do so.
Check if the server in question supports FTP, then you can just use FTPClient#listFiles() for this. If it doesn't, but it supports directory listing, then you need to parse the HTML response containing the directory listing with a HTML parser like Jsoup and then refire a new request on every found link.
If it doesn't support FTP or directory listing, then you're lost and you're probably trying to do bad things.