snipt

Ctrl+h for KB shortcuts

HTML

Magento Order Upload Extension

Want to attach photos or upload files into each product on the product details page, then just install this extension without doing any hacks to your core Magento files.
http://mage.club/magento-extensions-club/magento-image-order-upload-extension.html
https://snipt.net/embed/3e7910f94d572f1e18cbe9e8db1f6e7b/
https://snipt.net/raw/3e7910f94d572f1e18cbe9e8db1f6e7b/
3e7910f94d572f1e18cbe9e8db1f6e7b
html
HTML
2
2016-09-12T07:50:23
True
False
True
Sep 22, 2014 at 04:13 AM
/api/public/snipt/136541/
magento-order-upload-extension-65c60c38
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>Want to attach photos or upload files into each product on the product details page, then just install this extension without doing any hacks to your core Magento files. </span><span id="L-2"><a name="L-2"></a>http://mage.club/magento-extensions-club/magento-image-order-upload-extension.html </span></pre></div> </td></tr></table>
"magento extension", "order upload", extension, magento, order, upload

Text only

php.ini : Increase the Input file number on a single page

Edit php.ini :
max_file_uploads=500
https://snipt.net/embed/f8db92eaedb8c84854ba44f70913293c/
https://snipt.net/raw/f8db92eaedb8c84854ba44f70913293c/
f8db92eaedb8c84854ba44f70913293c
text
Text only
2
2016-09-22T00:36:31
True
False
True
Aug 28, 2012 at 04:03 AM
/api/public/snipt/45954/
increase-the-input-file-number-on-a-single-page
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>Edit php.ini : </span><span id="L-2"><a name="L-2"></a>max_file_uploads=500 </span></pre></div> </td></tr></table>
php.ini, upload

CSS

Custom upload input

1
2
3
4
5
6
7
8
.upload, .upload input {width:106px;height:37px}
.upload {background:transparent url(browse.png) left top no-repeat}
.upload input {opacity:0}

/*
 * USAGE:
 * <div class="upload"><input type="file" /></div>
 */
https://snipt.net/embed/8357619bcb46b5dd60da883108252a88/
https://snipt.net/raw/8357619bcb46b5dd60da883108252a88/
8357619bcb46b5dd60da883108252a88
css
CSS
8
2016-09-25T21:19:05
True
False
False
/api/public/snipt/41850/
custom-upload-input
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nc">.upload</span><span class="o">,</span> <span class="nc">.upload</span> <span class="nt">input</span> <span class="p">{</span><span class="k">width</span><span class="o">:</span><span class="m">106px</span><span class="p">;</span><span class="k">height</span><span class="o">:</span><span class="m">37px</span><span class="p">}</span> </span><span id="L-2"><a name="L-2"></a><span class="nc">.upload</span> <span class="p">{</span><span class="k">background</span><span class="o">:</span><span class="k">transparent</span> <span class="sx">url(browse.png)</span> <span class="k">left</span> <span class="k">top</span> <span class="k">no-repeat</span><span class="p">}</span> </span><span id="L-3"><a name="L-3"></a><span class="nc">.upload</span> <span class="nt">input</span> <span class="p">{</span><span class="k">opacity</span><span class="o">:</span><span class="m">0</span><span class="p">}</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c">/*</span> </span><span id="L-6"><a name="L-6"></a><span class="c"> * USAGE:</span> </span><span id="L-7"><a name="L-7"></a><span class="c"> * &lt;div class=&quot;upload&quot;&gt;&lt;input type=&quot;file&quot; /&gt;&lt;/div&gt;</span> </span><span id="L-8"><a name="L-8"></a><span class="c"> */</span> </span></pre></div> </td></tr></table>
css, input, upload

PHP

clean filename

1
2
3
4
<?php

// clean filename:
$filename = preg_replace("/[^a-z0-9\-\.]/i", "_" , $filename); 
https://snipt.net/embed/d0742c5953ff7f605e76470beec9f31c/
https://snipt.net/raw/d0742c5953ff7f605e76470beec9f31c/
d0742c5953ff7f605e76470beec9f31c
php
PHP
4
2016-09-24T10:35:33
True
False
False
/api/public/snipt/30588/
clean-filename
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c1">// clean filename:</span> </span><span id="L-4"><a name="L-4"></a><span class="nv">$filename</span> <span class="o">=</span> <span class="nb">preg_replace</span><span class="p">(</span><span class="s2">&quot;/[^a-z0-9\-\.]/i&quot;</span><span class="p">,</span> <span class="s2">&quot;_&quot;</span> <span class="p">,</span> <span class="nv">$filename</span><span class="p">);</span> </span></pre></div> </td></tr></table>
clean, file, image, php, upload
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.