In rails, File name gets deleted in file field when reloading the page - filefield

In any rails form, when we are uploading a file, file name getting deleted when we left any mandatory field.
Also once we saved a file, again when try to edit the file file name is not display in edit form.
Please tell me solution for this issue. Actually we don't want to reset the file field after reloading the page.

what uploader plugin / gem are you using? carrierwave has a great feature to support persistence of uploaded files while redisplaying the form because of failed validations, see "Making uploads work across form redisplays" at https://github.com/jnicklas/carrierwave

Related

Can you save an image in angular without the backend?

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

Save As - html thymeleaf

we need to develop an application similar to the below
On the web page user is asked to select the parameters which are present in a Map<String,Boolean>. Once the user selects his choice of parameters then this Map is saved in a .DAT file. Right now I am saving it in C:/Users/Application. But I want the user to choose which directory he wants to save. I was tempted to use <input type="file".....> but it needs a file in the directory.
Is there any way that the user can specify his own directory where this .DAT file is saved.
Something similar to SaveAs..
A webpage cannot choose where the user will download a file that is returned. For some file types, the browser might even show the file instead of downloading it (e.g. PDF file).

Bug css file stuck in server?

I can't change one file in my project. Even deleted this file, its still exist in content send to client.

Chm file displaying Page can not be displayed

I have created compiled html (chm) file using the Microsoft html Help Workshop. when I tried to open the generated chm file, it is showing message "Page Can not be displayed". But when I click on content topic only then I am able to see corresponding page content.
Do I need to set any thing so show the selected page by default.
The short way:
If the CHM help file resides on a network drive please copy this file to a local hard drive first and try again. You'll find some additional and troubleshooting information at:
http://www.help-info.de/en/xml/maml_troubleshooting_hh.xml
http://www.grainge.org/pages/authoring/chm_mspatch/896358.htm
Problem: The help file will appear, but instead of the topic text you will see an error message "this page cannot be displayed".
Cause: Microsoft released some security patches that makes it impossible to view CHM files that are stored on a network drive (as opposed to CHM files stored on your own computer).
Solution: There is a work-around to allow viewing across a network as discussed on the following links:
http://west-wind.com/weblog/posts/2928.aspx
http://www.helpscribble.com/chmnetwork.html
The problems can also occur if the CHM file name or the path to the file contains a number sign (#). If the CHM file name contains the # symbol, then the topics in the table of contents do not appear. If the path contains the # symbol, then you may receive an access violation error message.
To work around this issue, remove the # symbol from the file name or from the path to the file.
If you have a compiled collection of CHM's (so called "merged CHM") some other problems are possible.
If you are new in using HTMLHelp Workshop:
Question: Is there a way to set a default page to be displayed when a .chm file is opened? I would like to display the page associated with the first item in the Table of Contents.
Answer: You can do this with Microsoft HTMLHelp Workshop.
Open your HHP file with HH Workshop
Click the first icon "Change project options" on the "Project" tab
Set the "Default file" from the file list of the combo box
Compile your project
HHP file example (open with notepad):
\\\
..
[OPTIONS]
Binary TOC=No
Binary Index=Yes
Compiled File=Help_Coding-Example_VB6.chm
Contents File=Help_Coding-Example_VB6.hhc
Index File=Help_Coding-Example_VB6.hhk
Default Window=main
Default Topic=index.htm
..
///
There is a solution:
In your HTML Help Workshop go to the "Project" tab
Press button "Change project options"
In the "Default file" field put the name of your default file which is already exist in your project. File should have .htm extension (for example about.htm)
Compile project again and you will see that problem is fixed

HTML 5 - load text from text files

I am facing problem in HTML 5. I need to statically load data into web page from local saved files. Up to now, I have been only able to load data via < input type="file" id="fileinput" / > but I want to load data from static location, which never changes. How to do that? And is there any way how to determine, whether some local file was changed from previous version?
Thanks
no, this isn't possible if by 'local', you mean a file at /home/waypoint/somefile.txt. You can make a 'link' with the filesystem api (if you selected it in an input field, for instance), which is valid to do computations with it (to read it, write to it, display it in img,etc). But it is deleted/unvalid, as soon as the window closes. If you could just magically "read" any local file via javascript which resides on the file system, who would stop google to read out your /etc/passwd file?
if your local computer is also your server and therefor your server-side code has access to the local file /home/waypoint/somefile.txt, your app can get it via ajax. Checking if the file exists, would be done the same way.