Source language: Translate to:

the question about "File input"

General questions about NeoAppBuilder - our rapid application development tool for building HTML5, web and mobile apps.

Moderator: Neosoft Support

the question about "File input"

Postby anton » Wed Oct 18, 2017 6:45 am

Who understood how to work with the "File Input" object?

the built-in object gives:
Code: Select all
["qip.jpg"]
0: "qip.jpg"
length: 1
__proto__: Array(0)


And if you use:
<input type="file" onchange="console.info(this.files);" />
we obtain:
Code: Select all
FileList {0: File, length: 1}
0:File {name: "qip.jpg", lastModified: 1505821240418, lastModifiedDate: Tue Sep 19 2017 14:40:40 GMT+0300 (RTZ 2 (зима)), webkitRelativePath: "", size: 64682, …}
length:1
__proto__:FileList


Why convert to an array:
Especially this is unclear because the choice of several files is prohibited.
Code: Select all
function fileObjToArray(files){
   if(files){
      var arr=[];
      for(var i=0;i<files.length;i++){
         arr.push(files[i].name);
         }
   return arr;}
return''}


Let it just return the files:
Code: Select all
<span class="btn btn-primary">Browse… <input type="file" style="display:none" onchange="return angular.element($('#FileInput1')).scope().FileInput1_change(this.files)"></span>


You can write a plugin to work with this object. And now what's the use of it. What gives me this "array" containing the file name...
User avatar
anton
 
Posts: 60
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Postby anton » Fri Oct 20, 2017 7:31 am

Ah, people, is there anyone alive?
User avatar
anton
 
Posts: 60
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Postby DELCO » Sun Oct 22, 2017 4:29 am

I don't think so... Unfortunately...
User avatar
DELCO
 
Posts: 132
Joined: Fri Apr 01, 2005 9:12 am

Re: the question about "File input"

Postby anton » Mon Oct 23, 2017 11:10 pm

It's very sad that so
User avatar
anton
 
Posts: 60
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Postby luishp » Thu Oct 26, 2017 1:03 am

Sorry Anton, I don't know how to use the File Input object either.
In any case I still use and strongly support NAB.
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
User avatar
luishp
 
Posts: 359
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Re: the question about "File input"

Postby anton » Thu Oct 26, 2017 5:02 am

luishp wrote:Sorry Anton, I don't know how to use the File Input object either.
In any case I still use and strongly support NAB.


I also continue to work in NAB. I really like her.
I know how to work with "File input", but with how it is implemented in the developers, you can not work. This object turned out to be completely useless.

Increasingly, I want to get into the source code of the program and rewrite half of the code. It is a pity that there is no such possibility.
User avatar
anton
 
Posts: 60
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Postby Neosoft Support » Sun Oct 29, 2017 11:41 am

Sorry, the FileInput object is experimental and probably isn't usable in its current form. Selected files need to be stored in a JavaScript object in order to be useful. Unfortunately, there is no way to access JavaScript objects within the simplified NAB scripting language. Suggestions welcome...
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: the question about "File input"

Postby anton » Tue Oct 31, 2017 1:08 am

Neosoft Support wrote:Sorry, the FileInput object is experimental and probably isn't usable in its current form. Selected files need to be stored in a JavaScript object in order to be useful. Unfortunately, there is no way to access JavaScript objects within the simplified NAB scripting language. Suggestions welcome...


I suggest completely remove the "variable" from the "Input Files" object. Prepare a list of commands for working with this object. For example:
Code: Select all
LoadTextInputFile "FileInput1" [variable]
LoadImageInputFile "FileInput1" "Image1" or LoadImageInputFile "FileInput1" [variable]
NameInputFile "FileInput1" [variable]
SizeInputFile "FileInput1" [variable]


And many others...

See the demo and the example in the attachment:

[Download] [Demo]

Do not judge strictly, Demo wrote in a hurry ...
User avatar
anton
 
Posts: 60
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Postby stu » Tue Oct 31, 2017 10:21 am

I suggest open sourcing NAB and let the community take care of its continued development more or less as a tribute to what Neosoftware once was...
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am

Re: the question about "File input"

Postby luishp » Sat Nov 04, 2017 2:11 am

I think open sourcing NAB could be a good idea.
LiveCode, a multiplatform RAD, became open source and it still sells special licenses, plugins, courses...
It has helped the platform to get a much more bigger market share and to evolve quicker.
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
User avatar
luishp
 
Posts: 359
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Re: the question about "File input"

Postby farhad2008 » Sun Nov 05, 2017 8:13 am

I agree with you
good idea
The Words I Love You
farhad2008
 
Posts: 50
Joined: Tue Apr 01, 2008 1:15 am
Location: usa

Re: the question about "File input"

Postby Neosoft Support » Sun Nov 12, 2017 7:54 pm

Making NAB open source is an interesting idea. There are a few commercial and freeware libraries involved, so I'm not sure how to deal with those. Would they need to be removed? Where could the source be hosted - SourceForge?
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: the question about "File input"

Postby anton » Sun Nov 12, 2017 11:11 pm

Neosoft Support wrote:Making NAB open source is an interesting idea. There are a few commercial and freeware libraries involved, so I'm not sure how to deal with those. Would they need to be removed? Where could the source be hosted - SourceForge?


One of the most populous sites for such projects: https://github.com/ https://sourceforge.net/ https://opensource.google.com/

Any of them seems to me to be a good choice.
User avatar
anton
 
Posts: 60
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Postby stu » Tue Nov 14, 2017 6:40 am

Neosoft Support wrote:Making NAB open source is an interesting idea. There are a few commercial and freeware libraries involved, so I'm not sure how to deal with those. Would they need to be removed? Where could the source be hosted - SourceForge?


GitHub I'd say. Its the best out there.

The commercial libraries will probably need to be replaced, I doubt the authors will allow for their code to be shared on NAB repo. But maybe just share the compiled versions and add a licensing note in the Readme (?)

Open sourcing is definitely the way to go ;) maybe even Neobook. Ok, that was a long shot, but still...
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am


Return to General NeoAppBuilder Discussion

Who is online

Users browsing this forum: No registered users and 0 guests