ckeditor 4 how to upload image file without garbage file - laravel-8

I uploaded image file using ckeditor 4 ( uploadimage )
so, image file store in server ( ex. /image/123.img )
then, if i reload a page or move a other page
uploaded file still in server ( that's garbage file )
so, how to store image file without garbage file ?
are there any sites I can refer to?

Related

Upload webscrapped images from folder to database Django

I'm webscrapping data about ski resorts from a site, also getting some pictures. I am saving those pictures in a folder and after that i'm getting them in SQLite database through an imageField.
The bad part is that they don't work
directory = r'C:\Users\tiberiu.ghimbas\Documents\Resorts img5'
image_list = [cv2.imread(file) for file in
glob.glob(r'C:/Users/tiberiu.ghimbas/Documents/Resorts img5/*.png')]
This list is then looped and insertet item by item.
I'm doing all the correct settings for handling images and media files.
I know that by going the classic way of uploading images through a form will get you in the database the path to the image from de media/"upload_to = 'filename'" folder but going by my way i'm getting only them image name.
How can i solve that ?

Moving uploaded files in Socialengine

I tried moving uploaded file through browse action in socialengine from /public/user/ to /Files/SE/ by using
1.
$fileobj = new Zend_Cloud_StorageService_Adapter_FileSystem();
$fileobj->moveItem($sourcePath, $destinationpath);
move_uploaded_file($sourcePath, $destinationpath);
Both of these couldn't move the file. I have checked the paths too they are perfect and works with other frameworks
You should use API of Storage module which will allow you to create temporary files (when you need to resize images or convert videos) and then place them into public storage. This files will be tracked in engine4_storage_files table.
I got it worked by using createSystemFile() function under storage > Model > DbTable > Files.php
I created a function similar to this and gave parent_type as the folder which I wanted to move in the files.

Initial file list not showing actual files

I have implemented initFiles to display already s3 uploaded files, but actual image thumbnails are not showing. Also, I can not click on the default thumbnail that is shown (see image). How can I see actual images and link works?
I have below JS snippet
session: {
endpoint: "http://localhost/app/ci/php-s3-server/endpoint-cors.php?filelist"
},
Response from endpoint-cors.php?filelist call is...
[{"name":"art_collage.png","uuid":"e3554aa0-c025-4653-bb71-4afe9d979f06","s3Key":"test\/e3554aa0-c025-4653-bb71-4afe9d979f06.png","s3Bucket":"kidkivetest"},{"name":"process_step_2.png","uuid":"e5d84dd7-458c-4601-9168-e16e747134d0","s3Key":"test\/e5d84dd7-458c-4601-9168-e16e747134d0.png","s3Bucket":"xx_my_bucket_xx"}]
S3 bucket structure has 2 images:
All Buckets /xx_my_bucket_xx/test
e3554aa0-c025-4653-bb71-4afe9d979f06.png
e5d84dd7-458c-4601-9168-e16e747134d0.png
If you would like to display thumbnails in your initial files list, you must provide a thumbnailUrl for each file in the list. For example:
[{"name":"art_collage.png","uuid":"e3554aa0-c025-4653-bb71-4afe9d979f06","s3Key":"test\/e3554aa0-c025-4653-bb71-4afe9d979f06.png","s3Bucket":"kidkivetest", "thumbnailUrl": "http://mys3bucket.com/art_collage.png"}...]

Storing Uploaded file in database

I place a simple fileupload control in my webform application. firstly user have to login and his login username is stored in a session. then user have option to upload his pic. I place an image control.If pic is available it is shown in Image control. My fileupload code is
string sp = fileuploadpanno.FileName;
string fn = Server.MapPath("~/panno/" + sp);
fileuploadpanno.PostedFile.SaveAs(fn);
My question is how to save this file into database. I am using mysql database.
You could potentially store the image in the database directly by first converting it to a BLOB.
A more widely used practice is to store the image in a directory/location such as App_Data or Temp and then store the image name in your mysql database. Then when you want to reference the image in your web application you can just use a normal image tag with the source being the location of the image concatenated to the image name you retreive from your database.
So for example if I have a directory /App_Data/Images/
And I store an image name in my database called my_image.jpg
After moving the image above to the directory above (save it in this location) I can then reference it by appending the image name to the location /App_Data/Images/my_image.jpg

File object in WinJS - how to retrieve the containing folder

I have got a app with the getItemsAsync()-method returning a file-object for a picture chosen by the user with a file picker. Now I would like to get the folder-object of the folder which contains the image to make the user able to switch between the pictures in that folder without using the filepicker again.
The path is available upon return from the file picker. See:
Docs for StorageFile
You can in turn then call
Windows.Storage.StorageFolder.getFolderFromPathAsync(path)
.done( /* Your success and error handlers */ );
to get you the StorageFolder from that path.
Docs for GetFolderFromPathAsync()
if the app likely want to 'access' any file in the select folder, using FolderPicker is probably right. otherwise, the app will likely not have access to all files in the folder.