I'm trying to upload a photo from the web page to a node.js web server behind, I just cannot figure out how to upload the picture that Webcam-easy.js has generated by doing let picture = webcam.snap();, it also saves it to a canvas. It needs to be a POST request. The URL it need's to be uploaded to is /upload/ and the image needs to be tagged as file. When the backend gets it it saves the file to an uploads folder.
Related
I'm trying to upload a pdf file to my browser, but I want to be able to download this file afterwards. I am having problems on the second task - downloading it.
I'm uploading as follow:
<b-form-file v-model="form.file" :state="Boolean(form.file)" placeholder="Choose a file..."></b-form-file>
How can I download form.file content after upload is done?
Edit:
I found this API, which handles file downloads nicely.
You need to save the file somewhere on your server or on a storage service (ie Amazon S3) and then redirect the user to a link where the file itself is served.
The specific implementation is based on your backend implementation and your architectural choices.
In my app I need to upload an image to the server, and user needs to preview the file before uploading it. So do it like this:
Show an image preview before upload
But after posted to server and there may be some errors, I have to return it back to client. Of course, the preview image loaded on client was lost, now I want to load it back again but I can't find the file to load using javascript. I have tried some ways:
$("file-input-selector").prop("files")
or:
document.getElementById("file-input-id").files
These only work when I select another image on the machine. After posted back from server both ways show 0 files
Is there another way to get the file after posted to the server back?
I do have to show the last image uploaded to an FTP server on a website page.
Since the client I use to upload files to the FTP tries to connect to a localhost (127.0.0.1) I don't know why, I decided to use the FTP integrated system in the DLink IP webcam. The problem is that this system upload the photos normally, but in different folders for date and time (e.g.: folder: /20161211 (date) subfolder: /11 (time)).
I have already tried to upload to the ftp using the webcam snapshot setup and also I tried to upload the output image of a "video client" to the FTP but this one doesn't work since it tries to connect to localhost instead of the webcam ip (192.168.1.66) also if was set up.
So how can I show on the website the last uploaded image?
From UI using HTML input file, I want to upload images. In JavaScript, I want to store these uploaded images in a specific folder by creating a unique URL to the image. Later, I post the rest of the web-service and I send this image URL to store it along with some other data, and I want to display the images in the UI.
Can anyone please suggest a way to do this?
Your question is confusing, it is not clear whether you are talking about storing the file in browser or on the server. If you want to create a file/folder on your local browser filesystem and store the file in browser (before sending to server or cache a copy) you should read these two articals:
Create a file in browser filesystem:
https://www.html5rocks.com/en/tutorials/file/filesystem/
Create a data URL for image file:
https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications
I'm writing an esay live blogging app.
I have a form in the backend and I can upload to the server text messages or images.
At this moment everything is working with a simple file upload field, but I want to speed up the process so:
1) reflex camera attached via USB that save images in a local folder on my mac
2) a "preview" of the folder in the backend, updating live while I shoot picture
3) when I select a shot I will upload to the server (this is not difficult).
I cannot find the right plugin to "watch" and interact a local directory. Any idea?