Categories
Development

File path needed before Image upload using multer

I have to register a user with a profile image. I’m using a custom validation. For Schema validation I need a file path. But we can access the file path only when multer successfully uploads the image. Is there any other way to get a file path before uploading an image or any different approach […]

Categories
CMS Development Wordpress

Custome location for attachted images

I managed to upload images out of where blog (WordPress) is installed, and I’m wondering to see how can I update default attached image path. Few facts: The main website is installed on docker. main.com There is another stand alone WordPress website (blog) installed on docker: main.com/blog There is a subdomain on separate docker where […]

Categories
Development

upload a file via Angular form

I’m working in an Angular 9 project, is a CRUD and it’s already connect it to a mongo database, everything it’s working fine, I’m adding tasks perfectly, but I decided to included an input for upload a image, but it’s giving me a really hard time. I wil show the code of my frontend and […]

Categories
Development

How to return REST API response after utility execution is finished in expressJs

I have written one POST endpoint in expressJS with node.when I a make call to API It runs a utility with setInterval() and I want to send the API response after utility executes clearInterval(). How I can I wait and send response after utility execution is finished? Please see the code below REST API code: […]

Categories
Development

How do I upload a file using Fetch and Multer and post form data in the same request?

I am trying to implement a form that can post information to a server and if the user wants, he/she can upload an image with it. However, Every time I use fetch to send them to the server, only the text data is reaching the server whereas the file, comes with the value of an […]

Categories
Development

.then() block of promise does not work with await

I am working with React backed with Firebase. I am using an asynchronous firebase function to get the download URL for a file that I add. This function runs multiple times inside a for loop and to keep everything synchronized I use ‘async’ and ‘await’ to wait for the file to be added before moving […]

Categories
Development

.then() block of promise does not work with await

I am working with React backed with Firebase. I am using an asynchronous firebase function to get the download URL for a file that I add. This function runs multiple times inside a for loop and to keep everything synchronized I use ‘async’ and ‘await’ to wait for the file to be added before moving […]

Categories
Development

.then() block of promise does not work with await

I am working with React backed with Firebase. I am using an asynchronous firebase function to get the download Url for a file that I add. This function runs multiple times inside a for loop and to keep everything synchronized I use ‘async’ and ‘await’ to wait for the file to be added before moving […]