Welcome Guest, Not a member yet? Register   Sign In
i cant upload any thing except picture
#11

[eluser]InsiteFX[/eluser]
Here are the mime types for the above!
Code:
zip => application/zip,

rar => application/x-rar-compressed,

cdr => array(application/cdr, application/coreldraw, application/x-cdr, application/x-coreldraw, image/cdr, image/x-cdr, zz-application/zz-winassoc-cdr),

ai => application/postscript,

psd => array(image/photoshop, image/x-photoshop, image/psd, application/photoshop, application/psd, zz-application/zz-winassoc-psd),
You will need to add them to application/config/mimes.php

InsiteFx
#12

[eluser]Sara rad[/eluser]
thank you . i test it ! but this way dont work for me Sad

any idea !? :-s
#13

[eluser]Sara rad[/eluser]
nobody cant help me ?
#14

[eluser]InsiteFX[/eluser]
Show your code for your upload!

InsiteFX
#15

[eluser]Sara rad[/eluser]
Last night i change my controller to this :

Code:
// Set upload rules for screen
$config['upload_path'] = 'files/shop/';
$config['allowed_types'] = 'jpg|png|gif';
$config['max_size']    = '200';
$config['max_width']  = '1024';
$config['max_height']  = '768';

// Set upload rules for source
$config['source']['upload_path'] = 'files/shop/source/';
$config['source']['allowed_types'] = 'rar|zip|psd|cdr|ai';
$config['source']['max_size']    = '24000';

// Select random name
$data['art_saved_name'] = $this->send_art_model->select_rand_name('arts_for_sell');

// Set name for saveing file
$config['file_name']  = $data['art_saved_name'];
$config['source']['file_name']  = $data['art_saved_name'];

// END OF RULES SETTING --

// Load Upload Library
$this->load->library('upload',$config);

if( ! $this->upload->do_upload(array('screen','source')))
{
    echo $this->upload->display_errors();
}

and now script dont upload anything and show this warning :

Quote:Message: Illegal offset type in isset or empty

Filename: libraries/Upload.php

Line Number: 146

and file uploading library show this errors :

Quote:The upload path does not appear to be valid.

You did not select a file to upload.

But path is valid and i select a file .

i know my code is wrong , I hope you help me :x

thanks
#16

[eluser]Sara rad[/eluser]
Ops Smile im waiting for your help Big Grin
#17

[eluser]InsiteFX[/eluser]
Code:
// Set upload rules for screen
$config['upload_path'] = 'files/shop/';
$config['allowed_types'] = 'jpg|png|gif';
$config['max_size']    = '200';
$config['max_width']  = '1024';
$config['max_height']  = '768';

// this is no good, you can only have one like the top one!
// Set upload rules for source
$config['source']['upload_path'] = 'files/shop/source/';
$config['source']['allowed_types'] = 'rar|zip|psd|cdr|ai';
$config['source']['max_size']    = '24000';

Also show your code for your upload form!

InsiteFX
#18

[eluser]allaerd[/eluser]
Hello,

If i check my upload script i see i have:
Code:
if ( ! $this->upload->do_upload())
instead of:
Code:
if( ! $this->upload->do_upload(array('screen','source')))
.

Can you post you're view where you have youre FORM? Ik think youre error maybee in there!
#19

[eluser]Sara rad[/eluser]
View :
Code:
<?php echo form_open_multipart('send_art/final_step'); ?>
select category:
<p>
<select style="direction:rtl;text-align:right;" size="8" name="sub_cats[]" multiple>
    {sub_cats}
        <option>{cat_name}</option>
    {/sub_cats}
</select>    
</p>
<p>
    Price : &lt;input class="inputsw" type="text" name="price" id="art-name"&gt;
</p>
<p>
    Select art screen :
    &lt;input type="file" name="screen" size="10"&gt; ( jpeg , jpg , png , gif )
</p>    
<p>
    Select art source :
    &lt;input type="file" name="source" size="10"&gt; ( psd , zip , rar , cdr , ai )
</p>
<p>
    &lt;input class="check" type="checkbox" name="rule" value="ON"&gt;
    I read and accept rules .
</p>
<p align="center">
    &lt;input class="btn" type="submit" value="Back" name="next"&gt;
    &lt;input class="btn" type="submit" value="Submit" name="send_art"&gt;
    &lt;input class="btn" type="submit" value="Cancel" name="next"&gt;
</p>
&lt;/form&gt;
#20

[eluser]allaerd[/eluser]
can you try uploading one file first?

so change :
Code:
if( ! $this->upload->do_upload(array('screen','source')))
into
Code:
$field_name = "screen";
if( ! $this->upload->do_upload($field_name))

And maybee even comment the line in youre view where the second file input is.




Theme © iAndrew 2016 - Forum software by © MyBB