People who code: we want your input. Take the Survey

Questions tagged [file]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
8
votes
2answers
5k views

Generate xml file programmatically

I need to generate an .xml file from my extension. Inside Namespace/Module/view/adminhtml/ui_component/ folder, I need to do this pro-grammatically because the .xml file will be generated based on ...
8
votes
1answer
845 views

Please specify the product's required option(s) Custom Option type file

I got only one custom option, which is file type, I tried to add product to cart programmatically like this: $logoSku = 'lg-brnd01'; $productLogo = Mage::getModel('catalog/product')->...
5
votes
1answer
478 views

Magento 2 : Which File & Line app/etc/di.xml Config Will Load by App

I need to know, area wise config will load by application entry point files like /Magento/Framework/App/Http launch method. But I'm not able to figure it out app/etc/di.xml config load.
5
votes
1answer
1k views

Cannot read contents from file.. Warning! file_get_contents Magento 2

I have file type custom option.When i browse any image and add to cart the products then it shows me error. Please check attached screenshot. I have already give the permission. Please help.Your help ...
3
votes
1answer
2k views

Magento 2:i18n folder to custom theme

I want to edit .csv file in module-wishlist to my custom theme. I have copied the the file from module-wishlist and copied to app/design/frontend/vendor/theme/Magento_Wishlist/i18n/en_US.csv. ...
3
votes
3answers
580 views

Controller file was loaded but class does not exist in localhost

i am new in magento When i have setup my magento 1.9.0 website in local then after i am facing one error message during check out So can anyone please help me a:5:{i:0;s:51:"Controller file was ...
3
votes
0answers
68 views

Export sessions data from files to REDIS

We are moving from single server to multiple server setup for our store. The problem is that we are using file cache type and we want to preserve those sessions (long expiration, per management ...
2
votes
1answer
4k views

Download a file from Controller in Magento 2

I create a Product View Tab and fill this with some PDF download links. Now link in Magento 1.9 I create a controller to prepare the download response. I don't find any solution to download a file ...
2
votes
3answers
2k views

The use of function pathinfo() is discouraged Magento 2

I am checking uploaded file extension by pathinfo() function of php but in coding standard check it's shows The use of function pathinfo() is discouraged My code: $fileExt = pathinfo($file, ...
2
votes
5answers
2k views

How to connect SFTP in magento 2

I want to connect the SFTP in Magento 2 here is my code. use Magento\Framework\App\Bootstrap; require __DIR__ . '/app/bootstrap.php'; $bootstrap = Bootstrap::create(BP, $_SERVER); $objectManager =...
2
votes
3answers
1k views

Mage::log clear log files

I want to programmatically clear manual log-files in order to always only see the new Logging Code for the last iteration. Is it possible (e.g. via a parameter) to only log the last iteration with ...
2
votes
1answer
697 views

Magento 2.3.1 Download an excel file with PHPSpreadsheet

Trying to create a download button for an Xlsx file. Using PHPSpreadsheet for this however when downloading the file it seems corrupted with a stack trace at the bottom of excel files: Stack trace: #...
2
votes
2answers
1k views

File download not working

<?php namespace Modulename\Merchant\Controller\Adminhtml\Document; class Filedownload extends \Modulename\Merchant\Controller\Adminhtml\Document { protected $_downloader; private $logger; ...
2
votes
1answer
53 views

Add Javascript globally in Magento 2 backend

I have a custom extension that has a javascript file which need to run on every page in magento 2 backend to use jquery and ajax function, is there a way to do this action with custom extension?
2
votes
0answers
116 views

Magento 2.1 and symlinks

My server structure is as follows: /var/www/htdocs_webroot/shop -> symlink to: /var/www/shop/deploy_xxxx-xx-xx/htdocs So I can redeploy magento easily and switch back and forth with one simple ...
1
vote
1answer
708 views

How to programatically find files in a folder

I am creating a cron job for a Magento 2 site. This cron job will search for files in /var/custom_folder/ and will then process them. I already have the cron job setup and can handle processing ...
1
vote
1answer
302 views

Magento2: create pdf file option in product details page

I need an option to select the chose upload file (pdf) from admin site and that file will visible and have a download option for users On the product details page on frontend. below is sample images. ...
1
vote
2answers
1k views

How to add js file to module and insert it to module layout

I have a module which add layout to admin create order like this: app/design/adminhtml/default/default/layout/mymodule.xml <?xml version="1.0"?> <layout> <...
1
vote
1answer
109 views

Cannot Delete file of Downloadable Product after it has been uploaded. Delete Button does not function under Samples or Links

Noticed after Patch Supee-8788 is applied, the delete button for the Downloadable Products does not work after the file has been uploaded, there is no way to delete files after they have been uploaded....
1
vote
0answers
16 views

SQL maxium innodb size issue

I am installing smtp extension suddenly I am facing with below Mysql error message https://prnt.sc/127cedv SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row ...
1
vote
0answers
88 views

files saved from custom options 'file' delete after x days

I have products where the custom option 'file' is selected' all those files are saved in the folder "pub/media/custom_options/quote/x/x" the names are difficult to track: ...
1
vote
0answers
24 views

File permission

Using Linux,centos7,cloud server.having 3 accouts. About file permission, sometime getting warning can't inside the website, need to refresh 2~3 times. How to fix file permission, we don't want every ...
1
vote
0answers
24 views

Virtualmin backups - Strange blank “Files” within backup that cannot be read

I have setup a Virtualmin backup that appears to be working correctly. However, when the backups are attempted to be extracted there is a large amount of errors. WinRAR error below: This appears to ...
1
vote
1answer
431 views

Why magento automatically generate different file size images in cache folder?

I have a website builder with Magento 1.9.3.4, and I used a paid template package on the site, the package has 5 themes, my site only used the default theme and I found my server disk space was ...
1
vote
3answers
2k views

How to create json file in magento 2

I need to create a json file with data and store that file in specific directory of magento 2. Can any one please tell me how we can achieve this in magento2 in standard way like file system. Please ...
1
vote
1answer
478 views

Fail to import large file on Magento 2 from admin

I succeeded importing a csv file size 319KB with 357 products. But failed to import a csv file size 571KB with only 349 products. Please help me to fix the problem.
1
vote
2answers
31 views

Magento:Template File

I want to add a custom button in checkout page through my module without affecting any core functionalities of checkout module. http://i.prntscr.com/b2500547a0a747e5883be2a84fa43545.png
1
vote
1answer
244 views

Sort CSS files in Head [duplicate]

I am developing a Magento 2.1.2 shop based on the Bootstrap library. But the Bootstrap library should only get included in cms pages. So I added the following code in the file Magento_Cms/layout/...
1
vote
0answers
374 views

Magento 2 Can Magento\Framework\Filesystem\File\Write be “preference” or “plugin”?

Tried to use preference to override it, but errors appear when running "magento setup:static-content:deploy". Then I tried to use plugin, but I found that the system did not go to my customized ...
1
vote
3answers
721 views

I'd like to change menu on My Account page

I'd like to hide several menu on MY Account page to my customers. So I tried to change navigation.phtml file, but I couldn't find the menu on MY Accout page. The file was written like this <div ...
1
vote
0answers
233 views

Magento 2: Is there a dedicated folder for keeping PDF/image files for CMS pages and/or products?

Since Magento 2 has a default folder for storing images to be imported at [magento installation folder]/pub/media/import, does Magento 2 also have a dedicated (or recommended) folder for storing PDF/...
1
vote
0answers
10 views

File ___ optimized1.serialized in a media directories

What process/module created the file ___ optimized1.serialized on the web server (magento installation) in directories like media (containing pdf, png, jpeg)?
0
votes
1answer
833 views

Magento2 How To Read Data From Excel File

I want to read data from excel file (Not from .csv file but from excel file) . Does anyone know how can i get data from excel file ?
0
votes
2answers
3k views

magento2 : How to copy a file programmatically in Controller

I have a controller execute() function in which I would like to make a file copy from a directory to another. In Magento 1.9 I was using : Mage::helper('core/file_storage_database')->copyFile($...
0
votes
1answer
311 views

How work with pub/media folder? [closed]

I should get file (image) in magento2/pub/media/vendor_name/.... How can i do this? Thanks
0
votes
1answer
265 views

FileLock in Magento 2

I want to create a file locker in Magento 2. If i use the default \Magento\Framework\Lock\LockManagerInterface Magento uses the database to save locks by default. https://devdocs.magento.com/guides/...
0
votes
1answer
69 views

How to do a dry run in root folder? [closed]

Is there way to do a dry run within your root folder to make sure the line of code works
0
votes
1answer
5k views

How to fix “Cannot send headers; headers already sent” error in magento version 1.9.3.3?

a:5:{i:0;s:147:"Cannot send headers; headers already sent in /home/abc/public_html/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php, line 1";i:1;s:1783:"#0 /home/waterc/...
0
votes
1answer
265 views

Magento 1 get file size of upload

I want to display the size of the file in MB's using the php filesize option. But for some reason my code does not seem to work, it does not display the file size. The uploaded file is inside the ...
0
votes
1answer
2k views

Session files going over 17GB [duplicate]

Got warning from server regarding Disk space getting full. After checking into file manager I found 17.2 GB of file size in session folder. When looked into var/session folder, I can see unusual ...
0
votes
1answer
68 views

Search for specific load of file

Somewhere on my website the following file is loaded: data:application/font-woff;base64.... I want to remove this file, but I can not find out in what specific file it is loaded. Is there an easy ...
0
votes
1answer
147 views

is there a way to override firegento-magesetup2/Plugin/Catalog/ListProductPlugin.php

I just updated to latest magento2 but I have a Fatal Error which is related to this merge request https://github.com/firegento/firegento-magesetup2/pull/39/files and I would like to override without ...
0
votes
0answers
12 views

in magento 2.4.1 and 2.4.2 customer custom image type attribute not save in frontend

I create Custom Image type Customer Attribute for save image but while create customer from backend save attribute but i will not work in frontend, image attribute not save from frontside so please ...
0
votes
1answer
23 views

Magento 2 preference not working for Magento\Customer\Model\Metadata\Form\File

I want to create preference for this file Magento\Customer\Model\Metadata\Form\File but its not working so please give some solution for this problem how to solve it di.xml code
0
votes
1answer
32 views

How to install sm_market theme in magento 2.3.6

How to insatll sm_market theme in magento2.3.6. I want to install it manually.
0
votes
0answers
31 views

Connecting SFTP in Magento 2

I am still a newbie in Magento. I am looking for a way to read csv file for automating product upload to Magento. I will be receiving the csv file that contains the product attributes (data and images)...
0
votes
0answers
34 views

How to execute php file from magento admin in Magento 2?

I have created a php file on root folder of magento in Magento 2 and hit a controller on that file. That process is done and i have tested it it running on terminal. How would i run that script from ...
0
votes
0answers
22 views

magento 2 system configuration table feilds(file)

protected function _prepareToRender() { $fileInputRenderer = $this->getLayout()->createBlock(CustomShippingFile::class); $this->addColumn( 'shippingLogo', ...
0
votes
1answer
265 views

How to get PDF file URL uploaded in system.xml. Magento 2

I'm trying to upload PDF file via system.xml my code is <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
1answer
339 views

Delete a file from directory magento 2

Is there any way to delete files from var directory, if the file name matched with a condition. I need to delete log files based upon given date. Please let me know how to achieve this in magento2?