I am working on a project using Phonegap, i am creating profile page but the issue is that when user uploads new profile picture, picture successfully uploaded to the server, but it does not show updated picture in the profile, instead it shows the previous image, i know it is using the image from cache that was already there. So how can i avoid using the image from cache, i want new image from the server.
i used following code in ajax call but it is not working.
cache:false,
Related
I am facing a big issue for my project where basically nobody coming from Instagram browser cannot register, because after they upload mandatory image IG browser will reload the page (in normal browsers it works fine).
I even tried to simplify it to native html input - still happening. Also tried to put different attributes according to this question: Mobile browser refreshes page after uploading a photo using Camera but without any success.
You can try it on public URL: https://meetymeety-af1lom2yv-smoothweb.vercel.app/Explore
(you need to send it in IG message and open via IG). As you can see the page will always refresh right after image upload.
Any solution for that?
Note: We are using Next.js + React.js, but since these are just simple html inputs not connected to any state or whatever it has no effect on it.
I'm trying to find some info online on how to update my user's profile picture on the profile page in the same way that social media applications do it, i.e. by clicking on the profile picture itself and getting asked for the file upload straight away. However, all I'm finding online is options to create a form to do that job, but then it's going to be an upload button that does the job, which is not the same.
How do I get the image to be clickable, opening a file upload after I click it that would then update my model ImageField?
I have a set of web pages and i want to set them with a background image but it must be something the client chooses through an
so all the pages have the background image the user chooses
also i'm loading the page using a node.js and express backend.
I already tried uploading images but it doesn't persist it must stay that way even after they close the application
I expect that when you open the web page you see the background you choosed
EDIT: ok so i'm thinking about loading it from a image folder and then storing the name of the image in the database?
any ideas or suggestions?
You can use multer to upload the images to your server and then save the images with reference to the user [user id] that uploaded the image. So next time when that particular user opens the web page, you will have a reference to their saved images. I hope this helps.
I'm using Meteor and CollectionFS with S3 to serve both thumbnails and full-size images from the same collection, using different stores. I want to download the full-size image upon a 'dblclick' event.
var src = fileRecord.url({
store: 'images',
download: true
});
var a = $('<a>');
a.attr('href', src); // canvas.toDataURL(viewerImageObject.original.type);
a.attr('download', fileName); // canvas.toDataURL(viewerImageObject.original.type);
a.appendTo(document.body);
a.trigger('click');
Unfortunately, when that event fires, all the items in the frontend collection are removed-- which is rendered with a simple {{#each}} block helper over a cursor returned by a collection.find(). This is not persistent on the backend, only the frontend.
I've filed a CollectionFS ticket for this a week ago, and I've been trying to pick this apart to no avail. I also realize I could use FileSaver.js and a Canvas, but that'd get very frontend heavy on mobile and on large images, especially on polyfilled browsers.
How do I prevent the items in my collection from being removed upon downloading an image?
Solution: add target="_blank" to your anchor tag, this will make your browser opens a new tab for download link and everything will be fine
TLDR
Although I am able to make this worked, I am not sure what is the problem. It looks like that Iron Router will navigate your current tab to the download link you click on(but the url on address bar remains unchanged this makes me wondered), so that all the collections will be gone and your site goes blank
I am developing a mobile application that has this scenario: A user goes to one screen where they supply indexing meta data for an image. From this first screen they can go to a second screen where they select and upload the actual image to go with the meta data. Once selected, they go back to the first screen where they can then upload both the image and the meta data to a separate web service. Now, once the image has been selected and the user is back on the first screen, they may want to look at or change the image (that they previously selected) before actually submitting it to the web service. So I need to provide a way for the user to go back to the second screen and see the image they previously uploaded (without having to select it again). Clear so far?
In my ASP.Net MVC mobile application code I am caching the uploaded image to the server in a temporary file path on the server. Now I want to take that saved file and load it into a javascript image object so it can be displayed to the user when they go back to the second screen. How can this be done?
When you upload it to the server, the server can respond with a URL that can be used to retrieve the uploaded image. Capture that response and use it to set the src attribute of a new client-side Image object.