the question about "File input"

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

Moderator: Neosoft Support

Locked
User avatar
anton
Posts: 64
Joined: Fri Oct 19, 2012 9:21 pm

the question about "File input"

Post 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...
User avatar
anton
Posts: 64
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Post by anton »

Ah, people, is there anyone alive?
User avatar
DELCO
Posts: 135
Joined: Fri Apr 01, 2005 9:12 am

Re: the question about "File input"

Post by DELCO »

I don't think so... Unfortunately...
User avatar
anton
Posts: 64
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Post by anton »

It's very sad that so
User avatar
luishp
Posts: 410
Joined: Wed May 23, 2007 10:17 am
Location: Spain
Contact:

Re: the question about "File input"

Post 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.
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
User avatar
anton
Posts: 64
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Post 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.
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: the question about "File input"

Post 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...
NeoSoft Support
User avatar
anton
Posts: 64
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Post 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 ...
User avatar
stu
Posts: 322
Joined: Wed Aug 07, 2013 11:37 am

Re: the question about "File input"

Post 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...
User avatar
luishp
Posts: 410
Joined: Wed May 23, 2007 10:17 am
Location: Spain
Contact:

Re: the question about "File input"

Post 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.
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
farhad2008
Posts: 62
Joined: Tue Apr 01, 2008 1:15 am
Location: usa
Contact:

Re: the question about "File input"

Post by farhad2008 »

I agree with you
good idea
The Words I Love You
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: the question about "File input"

Post 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?
NeoSoft Support
User avatar
anton
Posts: 64
Joined: Fri Oct 19, 2012 9:21 pm

Re: the question about "File input"

Post 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.
User avatar
stu
Posts: 322
Joined: Wed Aug 07, 2013 11:37 am

Re: the question about "File input"

Post 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...
Locked