Git Product home page Git Product logo

Comments (8)

shuyu avatar shuyu commented on July 3, 2024

Hi ~ i think below code can give some help.

<div ng-controller="DemoController">
    <lf-ng-md-file-input lf-files="files01"></lf-ng-md-file-input>
</div>

The lf-files attribute is working same as ng-model, so you should fetch data from $scope.files01

var app = angular.module('demo', ['ngMaterial','lfNgMdFileInput']);
app.controller('DemoController',function($scope){
    $scope.$watch('files01.length',function(newVal,oldVal){
        console.log($scope.files01);
    });
});

After you selected file it should console a array on Developer Tool, then you can get what you want from objects .
e.g. If you only want get files to upload via ajax you should enum files01 and get file from lfFile property.

from angular-material-fileinput.

naumanahmed19 avatar naumanahmed19 commented on July 3, 2024

@shuyu thanks for snippet. yes I am able to get image data now. but I am little confused that how can i use in my forms.

right now on submitting form i am getting json object (item_info) with all fields data. should i merge or bind file01 and item_info or there is a better way to do this

from angular-material-fileinput.

naumanahmed19 avatar naumanahmed19 commented on July 3, 2024

okay that's how i did it
var logo = $scope.files01[0].lfFileName; $scope.item_info.logo =logo;
but wondering how to set image back to preview after getting from database.

from angular-material-fileinput.

shuyu avatar shuyu commented on July 3, 2024

Thanks for your recommend ~ I still look for a good solution to implement that ...

from angular-material-fileinput.

tkoykoy avatar tkoykoy commented on July 3, 2024

hi.. how can i get the file data?. i want to save that in another folder

from angular-material-fileinput.

locddspkt avatar locddspkt commented on July 3, 2024

How can I post this to php manually. I try to post the form but $_FILES is empty. I post all the form and do not use AJAX.

The question is how to use this with the classical type
Currently i use
<input name='image' type='file'/>

How do I replace this classical with the new style using angular-material-fileinput?

from angular-material-fileinput.

ayaolwan avatar ayaolwan commented on July 3, 2024

How can I post this to php manually. I try to post the form but $_FILES is empty. I post all the form and do not use AJAX.

The question is how to use this with the classical type
Currently i use

How do I replace this classical with the new style using angular-material-fileinput?

Do you solving this problem ?

I need help in same topic

from angular-material-fileinput.

ayaolwan avatar ayaolwan commented on July 3, 2024

@locddspkt

from angular-material-fileinput.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.