Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am trying to create an HTML form that submits a predetermined file upon the press of an input button. This file is not located on the machine running the html server, it is located on the end users machine. Idealy I would like a solution that is as light weight as possible.
As far as I know, it's not possible for a form to submit a local file without having the user select the file.
Browsers don't allow javascript (or other scripting technologies) to access the local file system, because it's a security risk.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 days ago.
Improve this question
Of course, I have read this question and know it is impossible in a simple way:
How to set a value to a file input in HTML?
However, I need it. For example, assume there is a User model that can have an attached file called avatar. Then, a user uploads their avatar image and tries to save what they typed in, but it has led to a validation error. Now, they expect the uploaded image to be there just like other text/number/date/etc. fields they filled. However, it is not done.
I could temporarily put the image into DB to show it again after the validation error, but do I really have to save it in DB? Is there any way that only uses browser and server RAM like a text field?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this question
i want to make a website that will not be accessed by anyone, there will be a login page in which you can't make an account, only for admins.
for example, i have a homepage which will be on example.com/homepage, if normal people accessed this they wouldn't be able to see it and instead get redirected to example.com/login unless they login with the right account they won't be able to go to the other sections of the websites.
This can be done by configuring your web server. E.g. Apache has multiple choices, the simplest one being with just two files https://httpd.apache.org/docs/2.4/howto/auth.html#gettingitworking
For more complicated solutions you'll need a server side programming language, like PHP.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Lets assume we have a web app which allows users to create and modify some dynamic structure (say, graph of some kind) and we don't want save changes permanently until the user clicks 'save' button. What is the best way to store and modify that dynamic structure?
Is it a good idea to use a plain JSON file on the front end, which we can modify according to user actions and then send to the server to update the database when user decides to save their structure? Or should we communicate with the server every time user makes some change, even if he can later decide to discard this change?
Is there a 'standard approach'?
You can use Locale Storage for this task. It's allow save data on client side.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I created a script using "Google-Apps-Script" that checks if an email has a specific label and a star, and then it takes the email attachment and sends it to another email address.
The script is working fine, but now I want to create a UI where the user can look at the attachment, fill out some text fields and this would result in the file being renamed.
I would then have a button to send that renamed attachment to another email address.
What would be the best way to achieve that ?
From what you have listed, I would go this route to create a GUI for that purpose.
https://developers.google.com/apps-script/guides/html/#create_html_files
You can use an HTML page as the GUI while the script handles everything on the back end.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I started creating online open source game as a project in school. It will be server with n connected clients. But now I have a problem with "security". What to do if one client would used modified source code for changing some restrictions? How can I prevent it? My first idea was make client only for connection to server and server would send all necessary files but I don't like this idea very much. Can you advise me something better? Thank you.
You need to keep your validations in the server. The server should check each client move, and if it's not allowed according to the server's rules - reject it.
You should still keep validations in the client, too, so that users who don't mess with the client code can get speedier responses.