# Importing via CSV

## How to create CSV file for import

Even though you can use any utility to create CSV files, the best option is to use Microsoft Excel.

We would recommend creating several attachments manually, then [exporting the file to CSV](https://productattachments.docs.foxnetsoft.com/broken-reference) to understand the structure of the file. Alternatively, you can download sample file below.

{% file src="<https://3870843390-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9cNqeRBWPLY1WjaJxQO3%2Fuploads%2Fpp9AaTbrnryOJjx3urVe%2Fattachments_20230221_224610.csv?alt=media&token=eb79ead4-2b4c-4643-bff9-c72b494a4c0f>" %}
Sample file
{% endfile %}

{% hint style="info" %}
When you import CSV file, attachments will be **added to existing** attachments. If you want to **overwrite** old attachments, make sure to delete old attachments via **Delete All** button next to Import buttons.
{% endhint %}

## Structure of import file

<table><thead><tr><th width="182">Column name</th><th>Explanation</th></tr></thead><tbody><tr><td>Published</td><td>True or False</td></tr><tr><td>Icon</td><td>Filename of the icon. Default icons have names with <strong>.png</strong> extension. <br><br>For example for pdf icon use <strong>pdf.png</strong></td></tr><tr><td>File name</td><td>Fill only if importing File.<br><br>This is only for the display in admin pannel.</td></tr><tr><td>AttachmentMode</td><td>File<br>FileUrl<br>HTML5Video<br>EmbedYoutube</td></tr><tr><td>File URL</td><td>If importing File, type URL on your store. Usually it would be <code>https://yourstore.com/files/attachments/file_name.pdf</code><br><br>If importing FileUrl, type URL<br><br>If importing HTML5Video, type URL to the video.<br><br>If importing YouTube Video, type <a href="embeded-youtube">iframe tag</a>.</td></tr><tr><td>Name</td><td>Display name for the attachment. Will be shown on product page.</td></tr><tr><td>ProductSource</td><td>To which entity map attachment.<br><br>Products, Categories, or Manufacturers</td></tr><tr><td>Ids</td><td>If mapping to Products, use SKUs of the products separated with <strong>SPACE</strong><br><br>If mapping to Categories, use <a href="https://importmanager.docs.foxnetsoft.com/what-is-id">Category Ids</a> separated with <strong>SPACE</strong><br><br>If mapping to Manufacturers, use <a href="https://importmanager.docs.foxnetsoft.com/what-is-id">Manufacturer Ids</a> separated with <strong>SPACE</strong></td></tr><tr><td>Language</td><td>Fill language Id (number). 0 means all languages.</td></tr><tr><td>Width</td><td>Fill only if using HTML5Video. </td></tr><tr><td>Height</td><td>Fill only if using HTML5Video. </td></tr></tbody></table>

{% hint style="warning" %}
If you are importing YouTube video, do not use Width and Height parameters. Use width and height in iframe directly.
{% endhint %}
