Categories
Mastering Development

How to fix an undefined json in angular?

I have a form with a uploader input to get an image "angular-file-uploader" npm library. but in the function that receive the data, it receive the data undefined, I can’t do a JSON.parse() with the data. I don’t know if the problem is in the backend (nodejs) but with postman the backend works. <angular-file-uploader #fileUpload1 […]

Categories
Linux Mastering Development

Automatically running a script on a file as it is created via SAMBA

I have a Linux machine acting as a local SAMBA file server. Most of the clients are Windows. The server is only accessible from within my intranet, and it only serves photos (jpg, gif, png, etc). What I want is to rename all files as they are created on the share, so that the filenames […]

Categories
Linux Mastering Development

How to ID images that have extra data attached?

I’m trying to extract images from a complex file. I’m able to break down that file in different sections and extract them all to different files. The idea then was to use file to detect the type of each sections and select only those that are only pictures (JPEG, PNG, BMP, …). And it works, […]

Categories
Mastering Development

Store Multiple Image paths into database in Laravel

Laravel 7. PHP 7.4. Hi! I’ve form in my website. Out of many fields, there is one field that let users allow to upload multiple images. I want to save the path for all images into database so that I can show them back on blade file. I can upload images and images are stored […]

Categories
Mastering Development System & Network

PHP Warning: PHP Startup: imagick: Unable to initialize module

I am getting following error when installed with lib imagick, but able to see the imagick module. Could you please check and help to resolve the issue without uninstalling the imagick module. Thank you Error: php_errors.log:[22-Jun-2020 17:40:47 UTC] PHP Warning: PHP Startup: imagick: Unable to initialize module php_errors.log:Module compiled with module API=20100525 php_errors.log:PHP compiled with […]

Categories
Mastering Development

Java JTable not showing on MacOS but on Windows

For an assignment we have to parse a XML File into a JTable. We created a ParserClass that gets the target file from a JFileChooser. After Parsing the XML, our programm hands over the required data into a TableModel for our JTable. We tested the programm on Windows in Eclipse and the JTable is perfectly […]

Categories
Mastering Development

How to get values of selected options by formidable.IncomingForm() in JS?

I need to get all values of selected options to send db. This is how I get values from Inputs type(text): let form = new formidable.IncomingForm(); form.parse(req, (err, fields, files) => { let info = {"_id": Number.parseInt(fields[‘_id’]), "name": fields[‘name’], "surname": fields[‘surname’], "phone": fields[‘phone’]} await dbProcess(‘visitor’,’POST’,info); res.writeHead(301, { ‘Location’: ‘/visitors’ }); res.end(); }); And this is […]

Categories
CMS Mastering Development Wordpress

File upload to the server by calling a PHP file from Javascript with xhttp.open(“POST”. xhttp.open fails when included in plugin

I have a piece of simple code that blends HTML with Javascript and calls a ajax php file to execute. It works perfectly if done in a standard HTML file with the ajax php file in the same folder. BUT when I lift the code and insert it into a plugin with a shortcode, the […]

Categories
Mastering Development

form is NOT submitted to store function Laravel 7

enter image description herethanks for helping me Iam new in Laravel Trying to submit form into store method : I made the following validation Request: public function rules() { return [ ‘photo’ =>’required|mimes:jpeg,jpg,bmp,png,gif’, ‘category’ =>’required|array|min:1′, ‘category.*.name’ =>’required’, ‘category.*.abbr’ =>’required’, ‘category.*.active’ =>’required’ ]; } } And This is my form route part goes to store method […]

Categories
Mastering Development

separate files in folder according to extension python

I have a folder that contains a group of files with different extension like .txt , .png , .pdf etc. I want to organize the files and save them in different folders, for example, each file.txt in one folder and file.png in an another folder and file.pdf in an another folder etc. import os path […]