image-upload-example | upload images from the ImagePicker , using a node | File Upload library
kandi X-RAY | image-upload-example Summary
kandi X-RAY | image-upload-example Summary
Demonstration of how to upload images from the ImagePicker, using a node backend to upload to S3
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of image-upload-example
image-upload-example Key Features
image-upload-example Examples and Code Snippets
Community Discussions
Trending Discussions on image-upload-example
QUESTION
I've been trying to write an api to upload image to server ,but all in vain. I'm using the laravel framework .And tried this example but it is not working.
Also while testing the api from POSTMAN ,I have passed mutlipart/form-data in the Headers.And in the Body tab selected form-data, added key = image, changed it Text to File and added an image.But when I test the api , don't know why but the image request is empty.
Maybe I might be passing something wrong in POSTMAN or there might be something wrong in my code,please do help me.
Here's my api code
...ANSWER
Answered 2018-Sep-30 at 05:02You can user core PHP code for file upload. In my laravel project I have used following code to upload file.
QUESTION
I'm trying to do uploading from my Ionic App to the codeigniter Rest Server but the image cannot be previewed when I open it. I'm referring to this tutorial to do the uploading from the app side https://www.djamware.com/post/5ae9c9ca80aca714d19d5b9f/ionic-3-angular-5-and-cordova-base64-image-upload-example
Here is my code from Ionic App:
...ANSWER
Answered 2018-Jul-17 at 03:53Look closely to your rest server side. You've been assigning $imgData
value twice which is replacing the value of the decoded base64 to an array value. That is why your code on the line file_put_contents($dir.$imgName, $imgData);
unable to get the image that you're trying to save.
You should place your code in this order :
QUESTION
I followed this example to upload images to my backend. https://github.com/expo/image-upload-example
The code I use in my RN application is:
...ANSWER
Answered 2017-Dec-14 at 15:20I sorted this out by just uploading the images to s3
QUESTION
I use Expo with react native and I am really stuck on this ... expo doesn't support firebase cloud storage which I have been using for ages to upload my images. So I am left with AWS S3 which I have never worked with. I already found this example on github: https://github.com/expo/image-upload-example/ but I couldn't get the grasp of what is the backend part about and what is apiURl that is used ... I apologize I haven't provide any code attempt but I am totally lost and I can't really see through the huge amount of bla bla bla documentation on AWS.
I have made it in the AWS S3 console so that the bucket I have created is accessed publicly. I have no problem for that. I don't need the user to be authed to upload images and any other restrictions just need to accomplish a simple upload.
So if anyone can help me through the code for this one. Thanks in advance.
...ANSWER
Answered 2017-Dec-02 at 03:57I haven't used Expo specifically, but I have setup my RN project to be able to upload to s3. Given the example you posted, it is fairly similar to what I ended up doing.
So obviously the first thing you need to do is go setup a bucket on AWS S3. From within the AWS console you should be able to find your specific access key and access secret, you will need both of those along with your bucket name.
The idea behind the example you posted, and what I ended up doing is to have a controlled server where you can safely use the access key and secret to create a unique "signed" url that can be used to upload the image directly into your bucket. You don't want to do this on your client b/c having a secret on your client is just asking to get hacked. Assume nothing on the client is ever completely secure.
I was already building a node server as the backend to my application so I had this part already up and running. If you are new to creating a backend server, I would suggest looking up how to setup an Express server here. You can host the app for free (with limitations) on a service such as heroku. There is even a great article covering this whole process in a bit more detail here. Basically you create a an app with a distinct GET
route that can be hit by your client app. That route will accept a query parameter with the file name of the file that is going to be uploaded. You should use the official aws sdk which will take your access key, secret, bucket name, and the file name then generate a unique url that will be sent back down to your client app.
Essentially what your client app will do is prepare the file needing to be uploaded. You should have the file name of the file ready and then you send a GET
request to the url route you just setup on your Express app. When you get a response back from your server it should contain that unique url. I then used react native fetch blob library to perform a PUT
request to that unique url you just received. If all goes well it should upload the file directly to that bucket securely. Make sure you set the Content-Type
in the header to the type of file you are uploading.
I know this isn't a bunch of code that will do the upload, but it should help you understand what is needed and get you heading in the right direction.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install image-upload-example
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page