File Upload : Listing previously uploaded files in Edit mode - javascript

I use PrimeNG File Upload in my Angular 6 project and upload files to a master record without any problem. On the other hand, when I edit this master record, I also let users to remove previously added files and add new files by using PrimeNG File Upload.
I think it is good idea to list previously added files (retrieving from Database) of the record as a list item outside of File Upload and display Delete icon right sides of each one. But if there is a possibility to display these previously added files on PrimeNG File Upload, I would like to use File Upload to list them besides adding new ones. So, my questions:
1) Is it possible to use PrimeNG File Upload for such an Edit Scenario and list files (from Database) on it?
2) Is it weird to list previously added files on File Upload element instead of HTML on the popup windows in Edit mode?
Any help would be appreciated.

Related

Cannot replace the file in Kendo React Upload API if same file is uploaded

Can I know what is the most relevant Upload property in Kendo React which is not allowed to the user to upload the same file again.
Same file been uploaded twice without asking if to replace the file
You can check manually what are in the list of the file upload and then replace that file with the new one or you can tell the user before uploading by checking if same file name already exists in the list if exists then tell the user that the same name file is already exists in the upload list do you want to replace it if yes you can replace it if no then auto rename the latest file uploaded as filename (1) like counter with it.

How to create File open dialogue box in javascript that will show files on server?

I have a webpage in which the clients should be able to open files on server, I need to open a file open dialog box, similar to:
<input type= "file" id = "select_file" onchange = "openfunction();"</input>
but this shows files available on local machine, it should list files available on server.
Your best option is to use already existing solutions like elfinder, because it's already solved problem and you certainly don't want to implement all this UI/UX yourself again.
There is no tag in HTML which will allow you to select file from server. You will have to implement everything from scratch.
Using <input type="file"> you cannot read server files since it is a post action to post the whole file and there is no such option at all to read file from server!!
The possible solution would be either to create a HTML UI for all the files existing in the server like dropdown or checkbox and then ask user to select the files required and perform necessary option.

jQuery File Upload - Get Folder Name

I'm using JQuery FileUpload in my web application. Things are working fine. Now i want to extend the behavior and get the folder name from uploaded file. Requirement is to get the folder name when user drop a file on page or select it through the file selection dialog. For this i tried to use callback "fileuploadchange" and "fileuploaddrop". Both worked and i was able to get the selected file collection i.e data.files but data.files[0] didn't contains any information about the source folder. Any idea on how this can be achieved ?
Thanks in advance.
You can only get info on what the user decides to "give" you, for security reasons. You might get that functionality by using some flash plugin, but with html/js you are not allowed into the users pc, not even folder names (thankfully)

Getting the all files in .zip file while uploading files

I'm trying to use uploadify control in MVC3. It works fine for uploading files.
Here is my problem:
How can i get the files in .zip file ?. Let me clear the question.
Here is a zip file (say : images.zip). It contains 3 jpeg files.
Now if i upload the images.zip file using upload control on my view page i need to get all the image files in the zip file.
If i uplaod images.zip file it should show all the images like this
I dont know how to get the files and how to start.
I've searched google but didnt get any clue about this.
How to get this? If any Jquery or Javascript code is avaliable please post.
If you can use .NET 4.5, there is a new ZipFile class that will let you get properties of a zipped archive.
If you're under 4.5, you will need a 3rd party zip file library, like SharpZipLib or DotNetZip.

Ajax based File Uploads

I'm looking for a javascript/ajax based file upload. The way it would work is this:
1) User clicks browse
2) User selects CTRL and selects the files he wants to upload
3) Via Javascript the user is shown a few loading graphics (1 per each file being uploaded)
4) After each upload finishes, a loading graphic is replaced with a success graphic and the filename of the uploaded file.
So what I'm really asking for is:
1) A way to do javascript/ajax based file uploads.
2) A way to detect when a file starts/finishes uploading, or to call a function when it happens.
Check http://valums.com/ajax-upload/ it's a neat plugin.
I recently faced a similar problem. We had been using Uploadify (http://www.uploadify.com/) to do uploads. I wrote a blog post on how to use Uploadify to perform multiple file uploads:
http://blog.bobcravens.com/2011/03/upload-multiple-files-with-progress-using-uploadify/
There are a couple of supported options:
Use a single 'input' element and select multiple files.
Use multiple 'input' elements to select a single file each.
Hope this helps.
Bob

Categories

Resources