Page 1 of 1

the question about "File input"

PostPosted: Wed Oct 18, 2017 6:45 am
by anton
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...

Re: the question about "File input"

PostPosted: Fri Oct 20, 2017 7:31 am
by anton
Ah, people, is there anyone alive?

Re: the question about "File input"

PostPosted: Sun Oct 22, 2017 4:29 am
by DELCO
I don't think so... Unfortunately...

Re: the question about "File input"

PostPosted: Mon Oct 23, 2017 11:10 pm
by anton
It's very sad that so

Re: the question about "File input"

PostPosted: Thu Oct 26, 2017 1:03 am
by luishp
Sorry Anton, I don't know how to use the File Input object either.
In any case I still use and strongly support NAB.

Re: the question about "File input"

PostPosted: Thu Oct 26, 2017 5:02 am
by anton
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.

Re: the question about "File input"

PostPosted: Sun Oct 29, 2017 11:41 am
by Neosoft Support
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...

Re: the question about "File input"

PostPosted: Tue Oct 31, 2017 1:08 am
by anton
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 ...

Re: the question about "File input"

PostPosted: Tue Oct 31, 2017 10:21 am
by stu
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...

Re: the question about "File input"

PostPosted: Sat Nov 04, 2017 2:11 am
by luishp
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.

Re: the question about "File input"

PostPosted: Sun Nov 05, 2017 8:13 am
by farhad2008
I agree with you
good idea

Re: the question about "File input"

PostPosted: Sun Nov 12, 2017 7:54 pm
by Neosoft Support
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?

Re: the question about "File input"

PostPosted: Sun Nov 12, 2017 11:11 pm
by anton
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.

Re: the question about "File input"

PostPosted: Tue Nov 14, 2017 6:40 am
by stu
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...