Welcome Guest, Not a member yet? Register   Sign In
how can i upload .doc file and .pdf file ?
#11

[eluser]Phil Sturgeon[/eluser]
I can't help but put this forward... "haha!".

I can see their frustration, the user guide does not show every single example of every possible implementation. It assumes you have a certain level of common sense in applying the examples to your own common needs.

Now while I find this hilarious, it is also pretty silly. Name slinging helps nobody. You suggest people should be helpful or be silent? Well lancemonotone you have said nothing helpful, so please, be silent.
#12

[eluser]lancemonotone[/eluser]
In what circumstance is it okay to be a jerk? The forums are supposed to be a place where we can come to get help and advice. Making fun of someone's lack of experience or knowledge is, by definition, being an asshole and it makes you look small. Furthermore, it's a waste of time and space for those who follow and have to wade through idiocy to find an answer. If you think the OP, who seems a little overwhelmed by the concept (but, in answer to Phil, we all started somewhere) is asking what you consider a stupid question, do you feel he deserves to be mocked asking for help? I fear you're going to answer these questions with more insults, but I'd really like to know.

At face value it's sad to see people acting that way towards others, but it's also sad for the community of CI users because it discourages people from developing with the framework, which in turn hinders the growth of CI itself. I don't think calling that guy on his behavior was hypocritical. In fact, stopping assholes from being such is very helpful because it promotes knowledge, so I disagree with Phil (whose Asset library I use in every CI project I do...thank you) on that point.

And yes, ignited, I'm a fag. Very perceptive.
#13

[eluser]Nicholas Bello[/eluser]
LOL! Smile

No hard feelings mate. I was just being a troll. :\
#14

[eluser]Phil Sturgeon[/eluser]
Let's wrap this up.

To upload a .doc or a .pdf then you can modify the user guide example like so:

Code:
<?php

class Upload extends Controller {
    
    function Upload()
    {
        parent::Controller();
        $this->load->helper(array('form', 'url'));
    }
    
    function index()
    {    
        $this->load->view('upload_form', array('error' => ' ' ));
    }

    function do_upload()
    {
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'doc|pdf';
        
        $this->load->library('upload', $config);
    
        if ( ! $this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());
            
            $this->load->view('upload_form', $error);
        }    
        else
        {
            $data = array('upload_data' => $this->upload->data());
            
            $this->load->view('upload_success', $data);
        }
    }    
}
?>

That is an example of a controller that uploads a file. It will force it to be a .doc or a .pdf by using the 'allowed_types' config item.

I like to mix being an asshole and being helpful. I would say I have a good help-to-ass ratio, but now and then we all get frustrated with users putting in nowhere near enough information for us to give useful help.

Let that be the end of it.
#15

[eluser]lancemonotone[/eluser]
See? We CAN all be friends. I understand the frustration towards lazy people but my point is that it's actually easier to ignore the post than to be insulting. And this is my humble opinion but it seemed to me than the OP was not so much being lazy but rather was just new and didn't understand the fundamental concept (and maybe doesn't speak English well enough to ask a cogent question).

It's all good. I just have an overactive sense of fairness.




Theme © iAndrew 2016 - Forum software by © MyBB