How To Upload Excel Data In Laravel? - excel

I have problem with importing thousand data into phpMyAdmin. I do import and it just cause null. And I can't input it manually one by one. I need something helpful with that problem.
Thanks if you willing to help me.

As you named phpMyAdmin I guess the problem is importing to the database.
MySQLDumper can help you importing and exporting massive database files:
To use it:
Download it from this link: https://sourceforge.net/projects/mysqldumper/
Place the content inside your webspace. eg: the htdocs folder
Start the script in your browser (http://www.yourDomain.de/yourFolder/mysqldumper/). eg: localhost/mysqldumper
Follow the Installation assistent
From there you could import or export to an existent database or to a new one.

The solution is to enter it 200,200...:(with chunk)
Ex:
//path is the path of excel file uploaded ex: /excel/excel.xlx
Excel::filter('chunk')->load($path)->chunk(200, function($results)
{
});

Related

How do you move the contents of a randomly named folder to a new location when you dont know what the folder name will be?

I am using requests to download an image with python. That part works ok. When I download a file I provide a name: sitea.zip . When that file is decompressed it contains a folder with a random name, something like ZX234564563SDSD, that has a qcow2 image in it named gw-vm.qcow2.
I need to move the gw-vm.qcow2 to a specific folder for each site that I download an image for.
I can't figure out how to cd into that randomly named folder to get at the gw-vm.qcow2 file.
Right now I am using os.system('unzip sitea.zip') to decompress.
I don't know how to cd into the resulting folder to then perform the following: os.system('mv gw-vm.qcow2 /opt/unetlab/addons/qemu/sc-branch-a-1.0/gw-vm.qcow2')
Any direction is appreciated.
It's going to be a function of os.walk() -- it performs a dirwalk on a directory. Check out the docs on it: https://docs.python.org/3/library/os.html?#os.walk
Good luck, hope that helps!
(edited formatting)

Importing Excel records on Filemaker Server using PSoS

New to FileMaker server and have been trying to roll it out for my own company but running into a problem I can't seem to solve or find the right answers to online.
I am saving an excel file called import.xlsx in /Library/FileMaker Server/Data/Documents/ and using a variable filepath to point to the file this script does not work when used in PSoS step. However if I specify the file locally whilst using FMP, and using only the script "Import Test" the import works fine.
Is it a problem with the variable filepath I have set? Or have I missed something out? I have included the two scripts that I wrote to try and make the import happen via PSoS. Any help or advice would be greatly appreciated!! - Yong
Script to Trigger PSoS "Import PSoS Button"
Commit Records/Request
Perform Script on Server[ "Import Test" ]
Script to Import Records from Excel "Import Test"
Go to Layout [ "Test" (Test) ]
Set Variable [ $filepath ; Value: "filemac:" & Get(DocumentsPath) & "import.xlsx" ]
Import Records [ With dialog: Off ; Source: "$filepath"; Worksheet: "" ; Add; Mac Roman ]
UPDATE:
I have tried using a .csv file in the place of the .xlsx file and the script works perfectly. Still not sure why a .xlsx file doesn't work as it is stated that FileMaker server 15 supports .xlsx import records script step (http://help.filemaker.com/app/answers/detail/a_id/12067/~/import%2Fexport-script-steps-with-filemaker-server-scheduled-scripts)
You should not need to prepend the path with "filemac:" since the function gets the correct path. Can you try it without and see if that does it?
Just to update that I figured out what is wrong after all these time. Filemaker Server does support server side imports with .xlsx, what was going wrong was the file rights that is inside the /Library/FileMaker Server/Data/Documents/ folder. To have server side imports to work, you have to make sure that for the specific file .csv or .xlsx, you have to make sure that either (fmsadmin) or (fmserver User) has read rights to that file. Add it if it doesn't.
Can't believe it has taken me that long to figure that out. Not sure why this isn't documented anywhere. Hope it helps whoever else is facing this problem, cheers!
YS

Can't import XLSX files into Magento

I've got an XLSX file, filled with zip codes - almost 3000. I can't seem to find a way to import the file, and I really don't want to type in every single zipcodes manually. Does anyone have a solution?

Magento: "Image does not exist"

I'm importing a CSV file in Magento (version 1.9).
I receive the error: 'Image does not exist'.
I've tried to do everything I could find on the internet.
The template I'm using for upload is the default template taken from my export folder.
I've added the / before the image name and I've also saved the file as UTF-8 format.
Any advice would help.
Use advanced profiler
System > Import/Export > Dataflow – Profiles
You only need to include the attributes that are required, which is just the SKU. Plus the appropiate image attributes. Plus labels if you want to go all out.
When you are creating your new profile, enter the following settings:
Now you can hit save! With our Profile now complete, we just need to create the folder media/import. This is where you will be storing all your images awaiting import.
When uploading images, they need to be within a folder called media/import. Once saved to that folder you can then reference them relatively. By that I mean if your image is in media/import/test.jpg in your csv reference it as /test.jpg. It’s as easy as that.
Please check this link for more information
Import products using csv
in the Default Import
first move all the images in media/import folder and then use '/imagename' in csv and then import.
And give the 777 permission to the import folder.
Let me know if you have any query....
check 3 point before upload csv file in Magento
create media > import folder and place all images inside import
folder import folder should have 777 permission
the path of images should be /desert-002.jpg
It may issue with image path in CSV if a image path in CSV is abg/test.jpg then it path in Dir is ..media/import/abg/test.jpg.also check image extension letter issue. Suppose your image extension I'd JPG and you rewrite in CSV is jpg .then it show image not exits
Your file template must look like this:
sku,image
product-001,/product_image.jpg
This file must exist: yourdocroot/media/import/product_image.jpg
More detail please read this method:
Mage_Catalog_Model_Convert_Adapter_Product::saveImageDataRow
You will see these lines:
$imageFile = trim($importData['_media_image']);
$imageFile = ltrim($imageFile, DS);
$imageFilePath = Mage::getBaseDir('media') . DS . 'import' . DS . $imageFile;
I hope this help!!!

Excel Object in asp.net

I have a serious issue.
I am using excel object for opening the excel file
it works fine i my PC.
when i make application as a website and running the page and uploading it gives the error "'C:\Documents and Settings\Administrator\Desktop\Work\SABRE MSO Mapping Request Template.xlsx' could not be found. Check the spelling of the file name, and verify that the file location is correct. If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved, or deleted. ".
I think it taking server path...but i want to open client excel file before saving the file to the server.
Plz help.
have you tried server.mappath() method ?? Do you have proper permissions setup to access the folder??
Are you passing complete file path to the excel for opening the file? Please try this:
if (fileUpload.HasFile)
{
string fileName = "PATH_RELATIVE_TO_YOUR_SITE" + "FILE_NAME";
fileUpload.PostedFile.SaveAs(fileName);
//NOW open excel using fileName;
}
also you need write permissions to the path (folder) you are writing file to.

Resources