Can you save an image in angular without the backend? - html

I want to save an image in angular's Assert folder or in a folder created by me. I occupy the input file and a button, nothing more when I save the selected image, I want it to be uploaded or copied to said folders or folder. Can this be done without the backend?
I have been looking for information and watching videos but most of them either use firebase or some other service, I just want it locally. Please, your help would help me a lot.

If I understand your question correctly, you are asking if, at runtime, you can create a file in your Angular applications' 'assets' folder.
This is not possible, because the 'assets' folder is a compile-time artifact. It only exists in your source code tree. In the compiled application, the assets folder does not exist.
Furthermore, when the folder exists, it only does so on the computer on which you wrote the application. The user is running it in their web browser, which is generally running on their computer, not yours.
Now, if you are just asking if you can save a file on the user's computer, take a look at File Save functionality in Angular

Related

Flutter render downloaded html

I have an elearning APP in Flutter, which can render html files stored online. Now I want to download these files to assets, so they may be accessed offline. For this, I will download a zipped file with the entire html's folder and unzip it.
The problem is the html has many subfolders with it's own assets, which I would have to declare in the pubsp.yaml in order to access, but these downloadable htmls are constantly being added (every new course has new files).
I see a few ways to solve the problem:
Somehow declare access to subfolders in the pubsp.yaml.
As far as I know, this cannot be done.
Update the folder access for the installed APP dynamically.
As far as I know, this cannot be done.
Read the html file without unziping it.
I don't know if this is doable (I'm using webview_flutter_plus to render) and weather it would allow access to files in folders inside the zip without declaring them in the .yaml.
Pre-load empty folders inside assets that would mimic the html folder structure, declare them in the .yaml and then unzip and read the htmls from these folders. I would create some 100 of them in order to accomodate a large number of course downloads.
I believe this method would work, but it seems very cumbersome and inelegant.
So my questions are:
Would any of methods 1-3 work and if so how?
Would method 4 work?
Is it possible to reference folders in the .yaml file without them existing? It would make method 4 far easier.
Is there any other way to accomplish this? I cannot change the language, since the APP is months along, but plugins are fair game.
Thanks in advance!

ReactJS link to local HTML file from different folder/project

I'm using ReactJS to build a site, and I want to create a link (a href="relativepath") to a local HTML file so that when the user clicks on the link, it'll open up the html page. The local file is in a different folder X outside of the project, and I don't want to upload it into my src folder because the html file depends on a lot of other files in X. Is there a good way to do so?
I also want to upload a different local HTML file that is already within the src folder of my React App. I currently have something like this:
import htmlFile from "../links/htmlFile.html"; export default function Something(props) { return (<a href={htmlFile}></a>)}
and it says in my terminal that
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <html>| | <head> >
I already tried adding in webpack + an htmlLoader, but I think I followed the steps incorrectly as I wasn't able to get it to work. I uninstalled those packages, so I'm now back to square one.
Thank you so much!
Just linking to or importing from a local file in some other location won't work unless those local files are also deployed to the server in the same location relative to the app (and the web server has access to that location).
So you'll need to copy the file and its linked dependencies in a folder that will be deployed along with your react build, but not where it'll get treated as part of the react codebase so webpack will try to compile it (so not in src either).
If you used create-react-app to set up your application, for example, this would be the public folder; other webpack setups may use different names but the general concept is the same.

save folder in source to disk in chrome

I want to save all the files of a specific source folder in chrome to a local folder, I found this but it seems can't do the job, I know I could save the file one by one, but since there are various files, mistake could happen and it's not boring to save one by one , so I want to know is there any way that I could save a folder to a local folder?
Thanks

Can I use asp FileUpload to select a folder?

I need something like the FileUpload control in asp.net that will allow the user to browse for a folder and enter a file name of a new file to upload.
From what I've seen FileUpload requires a file to be selected. It seems that html input type="file" has the same requirement.
Thanks!
Selecting an entire folder is not possible in FileUploadControl as it is meant for a single file. Although you can have a Multi File Selection. Multiple File Upload User Control
C# has build-in FTPrequest class where you can create folders, upload files, delete files etc.
If you want to upload folders from a webpage, you cannot use this technology in the browser, then you will have to use a rich-client such as Java, Flash or similar plugin.
If you can provide the users with a Windows or Mac client, you can use C# (either .NET or Mono) for the FTP transfer.
ZIP files arent a problem for ASP.net nor C#, but you still only upload 1 file (zip-archive) and then its up to the server to unzip it using eg. C#. Look at 7-Zip which is opensource, then you might get some ideas too.
You could also just try and use the build-in lib for it (compression):
http://www.eggheadcafe.com/community/csharp/2/10050636/how-to-compress-and-decompress-file-in-c.aspx
or try this link...
http://www.aurigma.com/docs/iu7/uploading-folders-in-aspnet.htm

Load all images from internal application

I am trying to load all the .png files from an internal application folder into a list control and I am stuck on exactly how to do it. I have tried httpservice to get the folder and count how many images there are so I can loop through them but I just cant figure that out.
File structure
-src
-(default package)
-my application files
-icons
-all my .png files
httpService i tried:
<s:HTTPService id="loadAllImages" destination="/icons" result="gotImages(event)" fault="loadAllImagesFault(event)"/>
This always results in directory not found. Am I going about this completely wrong? Anyone have a suggestion?
You can't do this. To store an image within an Flash application (SWF or AIR), you must embed it either using #Embed('') in MXML or by using the [Class] method.
The only way to actually reveal a folder directory of an internal folder in an AIR app is by using File (which is an AIR only class).
var file:File = File.applicationDirectory;
file.browseForDirectory('icons'); ; //unsure if that will pull an internal folder or not, but you get the idea
If this is an external directory (doesn't sound like it is), I believe you would do it how you show in your question (although I have never needed to use this method, so I don't know if/how it works)