how to package a user selected folder for upload using javascript - javascript

I have a "file browser" website where the user can browse files and folders located on a remote file server. I need to allow the user to upload entire directories along with the subdirectories. The only method I've heard of that works is to zip the folder. How can I zip a directory that the user selects using javascript?
Right now the user selects a folder using the form element I just need to be able to zip the selected folder along with its contents.
I've seen references to using JSzip or client-zip among others. However, no one mentions how to reference the selected folder. Most suggestions specify the folder by name instead of the directory path.

Related

Google Picker API: Files in parent directory are not listed after coming back from subfolders

I am using Google Picker API to select *doc files from Google Drive. The base path shows all files in the drive initially. But after moving to a subfolder and returning to the parent folder, the previous file are not shown anymore.
When I return from a subfolder, I want to see all files in the parent directory. I also need to be able to upload files from different Google accounts.

Sending a created website to somebody

I am just a beginner in HTML (and soon JS), and I was wondering, once my website is complete (an html file made in either Sublime or Notepad), how do I get that website to other people? If I wanted to make a website eventually with my online portfolio of videos and images, how would I get it out to people?
Uploading website files are one of the very first steps users have to take in order to publish their creation on the Internet. This tutorial will provide a generalized example on how to upload a website using one of three basic tools:
What you’ll need?
Before you begin this guide you’ll need the following:
Access to the control panel of your hosting account
Your website’s files (preferably compressed in a .zip or .tar.gz
format archive)
(Optional) An FTP client and FTP login details of your hosting
account
Option 1 – Upload Your Website via Hosting's File Manager
Navigate to your control panel’s Files category and open File
Manager
After that, go to the public_html directory, which is the root
directory of your domain (for example http://www.domainname.com/).
Your files should be uploaded there. The directory may also be changed depending on what URL you want it to be accessed from. In case
you want the content to show up on
http://www.domainname.com/something/ your content would need to be
located in public_html/something directory.
To start uploading, right-click with your mouse and select Upload
Files option.
To unzip your archive, right-click it and press Extract.
Once the content is located in your desired location, you will be able to access it using any browser.
Option 2 – Uploading Your Website via FTP
Some users prefer using an FTP client, such as FileZilla, SmartFTP, CoreFTP, or any other in order to upload their website. In this example, we will use Filezilla.
Firstly, you will need to get your FTP details.they
are located in your control panel’s FTP Access section. If you are not sure what your FTP password is, you can easily reset it by pressing Change account password section.
Open FileZilla and input your FTP connection details into the fields
at the top of the program, then click Quickconnect.
Once you are connected to the FTP server, use the file browser on
the LEFT side of the program to find your website’s files on your computer. After you have found your website’s files, use the file the browser on the RIGHT side to open your public_html directory on the hosting server. Once you have done this, you can simply drag-and-drop files from left to right and they will be uploaded to the server.(OPTIONAL) Similarly, you can upload a compressed archive via FTP by dragging-and-dropping from left to right. You will also need to extract it via File Manager. Refer to the “Option 1 — Uploading your website via File Manager” part of the tutorial above for instructions on how to extract archives via File Manager.
Option 3 – Uploading Your Website via cPanel’s File Manager
Click on the File Manager icon, located under the Files category.
Once inside the File Manager, open the public_html directory.
Click Upload after entering the public_html directory.
You can click “Select File” to select a singular file, or simply
drag-and-drop your file to the outlined area.
Once the upload is complete, return to the File Manager and you will
see the uploaded archive in your public_html directory. Right, click
the archive and select Extract to extract the archive.
If you receive a prompt asking to specify the location the archive
should be extracted to, make sure to specify /public_html.
The archive is now extracted, all files should now be located inside
public_html. Navigate back to public_html and see if the files were moved successfully.
Your website should now be fully uploaded and accessible via your
website’s URL. All that remains is to access your website and check if everything works correctly. Simply type in your domain name in
your browser, such as http://www.domainname.com/, and check if your
website works to your satisfaction
you have just learned how to upload a website. As you may see, you can upload a lot of files at once via an FTP program more easily, however, each file will be uploaded one-by-one. As a result, it may take a long time for each file to be uploaded separately, so it is still strongly advised to create a compressed archive of your files before uploading them.
On the other hand, the File manager is useful for uploading one or two files quickly, since you do not need a separate program for the File manager to work and can update your website on-the-fly, while working on other tasks inside your hosting control panel.

How to allow user to set destination folder for downloaded files

In my web application there is a download button, when user clicks on it a file gets downloaded to the "Downloads" folder. I want to add an option where user can select the folder in which the file should be downloaded.
How can I do this? Is there any plugin available for this?
You will not be able to choose the user's download location with javascript or jquery. This can only be set from the user's end, It contains on the browser. otherwise it would violate user's security. What you can suggest is the file's name. Read more

Find the path of a local file or directory in javascript

We are building a web application to help people organize their local files; it has a text input field in HTML5/JS.
Ideal functionality: user clicks on the text box and it lets them select a file or folder on their local drive, which passes the path of said file or folder to our server.
Is there a JS API or HTML5 method to find a path to a local file and folder?
Due to browser security, you cannot get the file location from a FILE input. For that same reason, you will notice that FILE inputs always get reset to blank after a postback. This is because the browser will not persist or expose the file path as a security measure.

Input form Browse and get Folder Path and save in Text Input Javascript

Is it possible to use a File Input within a form to just navigate to a Folder, and then select just that folder? I don't want to select a file within it, just the directory. I'd like to do this rather than have folks type in the entire path to the directory...
In otherwords:
User clicks [Browse] navigates to folder, clicks [OK] and the Browse Input retains the folder path.
I am creating a form for users to submit where they need access granted.
No, that's not possible. There is no reason why a user would want to submit a local path to a web application anyway (besides some obscure local/intranet applications).

Categories