How to let users upload or change the uploaded images in one page, and display it in another page? [closed] - javascript

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 9 months ago.
Improve this question
How to let user upload image in one page, and then display it in another page? User can change the image and it'll be changed also in the other page. Also, I'm talking about using php / js / jquery / mysqli anything that's most efficient. (I'm just a beginner in this field so it'll be appreciated if you use some simple language :))
Edit: Yes I said that I'm a beginner, but that doesn't mean I don't know a thing about coding. Also, I saw a few solutions from youtube & other stackoverflows questions, but all of them is about either uploading and displaying in the same page or not being able to change the image.

Format the image into Base64 string
store it in local-storage
In another page get it from local-storage and assign to the id or class.
Suggesting the link that already have answered for
How to save an image to localStorage and display it on the next page?

Related

Need a way to refresh automatically update HTML if a text file changes [closed]

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'm trying to create a non intrusive pop up that refreshes it's displayed text on the fly if the content in a local txt file has been changed. Not sure of the best method to go about this. Using html and js for this.
The popup reads from a txt file, pops up on screen for a few seconds then pops back down, but how could I read the file and change what is displayed automatically?
Any help would be appreciated.
You can't read from local files unless the user drags them into your page, or loads them with a file input. Once that is done, a lock is placed on the file so that the file cannot be modified.
Basically, you can't do what you want to do.

Best way to create new window/page/modal for list of JSON data [closed]

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 5 years ago.
Improve this question
Thank you in advance for your help!
For a project I'm building a page for an animal shelter. On a page I have a list of available animals generated from JSONP data, with a picture and basic data.
I would like to create something so that if the user clicks on the animals picture, it shows the full info for the animal, and all the available pictures.
I'm not sure what the best way to do this would be? A modal? A new html page? We're only using front end (html, CSS, javascript).
you can use bootsrap modal as it fits perfectly to your needs and you can customize it the way you want :
https://v4-alpha.getbootstrap.com/components/modal/
Bootstrap modal is best to show full details.Because users dont want to load pages all the time.
For Bootstrap modal go to this link
https://www.w3schools.com/bootstrap/bootstrap_modal.asp
When you want to display with comments of that blog use new html page.

Should I use an S3 bucket with my form_for image uploader? [closed]

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 3 years ago.
Improve this question
I am looking to implement something like https://my.charitywater.org/p/campaignCreate (step 2) where a user can choose from a list of images to use. They are using fancybox which I am kind of familiar with so could use that in my implementation.
I would like to be able to incorporate this into my form_for.
I currently use carrierwave so a user can upload their own images, but I'm not sure if I should be storing my default images in a s3 bucket, for example, and pull them down from there (though will be re-uploading images already stored so unsure on performance implications there).
Is there a good place to start with this? Anything I should be thinking about here?
It is possible to use save images using remote urls in Carrierwave (see this Stack Overflow answer).
What I would do is build an interface with a sample of images pluged to a select input, which stores the url of each image.
So that when the user submits the form, you have a field remote_image_url set.
Edit
But as you stated it would store images various times.
You can also have a list of image in your database attached to a model and use a rails relationship to link them.

How to show custom page for each .jpg image in directory [closed]

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 8 years ago.
Improve this question
I currently have a image uploader that uplaods images to my directory on my server. I wish to make it so I can do what a website such as lightshot does with images that are uploaded:
http://prntscr.com/3l83lw
I only want to center the image with a black background, I don't need anything fancy.
Any ideas on how I would go on about doing this?
what you're trying to accomplish is relatively easy.
You do need html/css/javascript/php knowledge in order to
accomplish it.
start reading tutorials such as these two:
http://www.lateralcode.com/create-a-simple-picture-gallery-using-php/
http://www.johnboy.com/blog/tutorial--php-photo-gallery-with-no-database
good luck !
Make a index page that collects the data after the '/'.
Takes that word, number or whatever, and matches it with the image uploaded in your server. Then you can display that image in the screen, inside a default page, for all users.

Save div = contenteditable to MySQL using PHP and JS [closed]

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 9 years ago.
Improve this question
Is there any possibility to save a DIV, that has contenteditable="true", to a MySQL Table? I need to use PHP for this (and JS as a "helper").
I though of doing something like this:
Putting a button on the site that copies the content of the contentEditableDIV to a formDIV (a DIV that is in a form with method="POST" action="send_to_mysql.php").
The button is supposed to auto-trigger the submit button/function at the same time.
But is there any other, more convenient way? I am quite a beginner in MySQL, so I couln't think of any other way yet.
I appreciate any kind of help or response.
With best regards,
Dave
Conceptually...
//contenteditable element
//read element with JS
//URIencode to PHP via JS/AJAX
//Send to database with PHP/PDO
You're in for a real can of worms if you want this to work well. Especially if you want this to work well AND be able to accept pasted content from MS Word.

Categories