Problems uploading blobs onto App Engine - google-app-engine

Hi i'm trying to upload some mp3s as blobs using the Complete Sample App code provided in the App Engine tutorial here and i'm getting the following error `HTTP ERROR 404
Problem accessing /_ah/upload/ag5jb2xsZWN0aXZlZ3dhcHIbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGHQM. Reason:
No upload session: ag5jb2xsZWN0aXZlZ3dhcHIbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGHQM`
Anyone have any ideas why i'm getting this? Tried running locally and even tried deploying the App and still having issues!

Do not press the back botton and try to upload file.Use to hit the url in browser every time.

For each upload of file to the blob, the blob url is unique. For the first time, when you upload a file, you might be creating one blob url, using
blobstoreService.createUploadUrl("/yourServerURL");
Now, when you try to upload next file, you are clicking back button and you are trying to use the same blob session which you have created for the first file. That is the reason, you are facing the "No upload Session" error.
The solution could be, you can create a new blob url when you click the back button. Do some work around to create a new blob url upon clicking the back button.
Hope this helps.
Thanks.

Seems to be a bug with SDK 1.4.3
This seems to work just fine with SDK 1.4.2
Does this resolve your problem?

Related

React file upload without using node - possible?

Is it possible to have a file upload work in React only without Node? I say this because every single article I read, node is involved. All I want to do is for a user to be able to upload a picture to my react app (filling in a simple form), and when they submit that form, a new post is created along with the picture they uploaded. I don't need the post to persist, this is frontend only. Is it possible to do this without node?
You can make this to work but you will need AWS or other Image upload services like Cloudinary.
You can create an account with AWS, create a bucket and use their SDK to push the image to them and they will return a URL.
Checkout this article though: https://javascript.plainenglish.io/how-to-upload-files-to-aws-s3-in-react-591e533d615e

Display images from API static folder on the client side in MERN application

I've got a MERN application that stores images to MongoDB. however, when trying to read the database and display the image back in the client application I keep getting the broken image icon.
I'm using Multer to successfully upload and store the images in the "/images" folder on the API side. I'm able to SEE the files being uploaded into that folder. I'm also using Path to declare the /images folder as a static folder.
on the client side I'm able to query the posts, get back the appropriate filename in the post.photo attribute and build up the source file location using a hard-coded PF constant (public folder). I'm logging out to the console that URL and when I copy and paste that built URL directly into a browser with the server running I'm able to see the picture successfully.
however, when using the URL for the image "src" I'm getting a broken image icon as shown.
I'll try to include a VERY watered down version of the code showing only relevant parts. any help would be greatly appreciated.
[Server Side][1]
[1]: https://i.stack.imgur.com/HkDbs.jpg
[Client Side][2]
[2]: https://i.stack.imgur.com/fJnXg.jpg
[Console App][3]
[3]: https://i.stack.imgur.com/KSunR.png
After weeks of wrestling with this I was finally able to get images to show in my client app! hopefully this helps someone else who might be having the same issue.
removed Helmet from the server side index.js file (it was part of a video instruction that I was following)
added a space-separated WHITELIST environment variable in the server-side .env file (ex: WHITELIST=http:http://localhost:3000)
then added the following code to my index.js code
code sample
Finally, somewhere along in the process I started getting "net::ERR_UNSAFE_PORT" errors showing up in my console. I wound up having to explicitly note my server ports like this "--explicitly-allowed-ports=5000,6000" in my browsers shortcut property by following the instructions noted here
https://superuser.com/questions/188006/how-to-fix-err-unsafe-port-error-on-chrome-when-browsing-to-unsafe-ports
that seemed to fix the issue for me!

Uploading file in react native Android

I'm making my android app with react native.
I want to make an upload(file, image) to my api server.
I searched in google, but I have some question.
The upload Flow what I thought is like below.
1. GET ACCESS TO LOCAL STORAGE
2. IF PERMISSION GRANTED, CLICK BUTTON AND MAKE POPUP
3. SELECT THE FILE/IMAGE AND GET URI
4. UPLOAD FILE WITH AXIOS
Am I thinking wrong? Is there a library to make it easier? Thank you
you can use react-native-image-crop-picker . it will ask for permission and you can take picture from camera or select image from gallery
if you want file other than image you can use react-native-document-picker
then upload file using axios

Error "The connection to the server was reset while the page was loading", While uploading .docx file

I am getting "The connection to the server was reset while the page was loading" error, while uploading a .docx format file. This is happening in all the browsers.
Uploading pdf, zip file formats are working perfectly.
Does anyone know why this is happening, and how it can be resolved ?
Try making a simple html upload page and see if it is possible to upload a .docx file. If it works, then your application code needs further troubleshooting and if by making a simple html upload page the error still persists; then your application code needs no changing, please do contact Godaddy hosting support for server support with this problem.
I am still having this issue with GoDaddy hosting which no longer allows uploads of some docx files. For now, a workaround is just to "Save as..." an older word .doc format which for me seems to work.

CKEditor image upload - getting the upload file

I was working on a very simple and fast image uploader for CKEditor. It works all like a charm, the only problem now is the actual upload. I thought it would all be easy, but now I am stuck.
I have the CK file-field and figured I could just run an ajax request to my php uploading script, the problem is now: how do i get the file data to upload it. The Ajax does not have the post values, so I am lost.
Please lead me into the right direction.
Thanks very much.
When you use Ajax to post the form, your file upload function should be able to get the values from the form as usual.
For example, see this article: http://www.finalwebsites.com/forums/topic/php-ajax-upload-example
Well, i now used an iFrame with the form in it. Using uplodify in the iframe it put the path to the file in a hidden input which I can extract from the frame and use as the src form my image in CKEditor.

Resources