Chrome extension to upload a directory

427 views
Skip to first unread message

anjana paulose

unread,
Feb 16, 2012, 2:45:28 AM2/16/12
to Chromium-extensions
Hi,

I have an existing extension for IE and FF, used to upload a directory/
multiple files from Windows or Linux.
This is achieved using C++ (ActiveX/XPCOM ).
My extension also has capability to extract icons from dll or exe in
windows.

1.Can i use NaCl in chrome to achieve the same?Using javascript in my
code, can i invoke C++ method to do the things.
2.Is it always necessary to have html file as part of extension to
hold the<embed > tag for nacl-module, or can i add it in my own page?

Please help
anjana

Chris Hughes

unread,
Feb 16, 2012, 11:57:47 PM2/16/12
to anjana paulose, Chromium-extensions
You would put the nacl in the extension background page and use the
messaging API to interact with the pages. One option is using content
scripts and passing messages to the background page that brokers
messages to the nacl bits.

Note that with nacl there are some limitations with respect to things
like raw sockets. You can use the npapi API to get around that but be
forwarned if you want to put it in the chrome web store, expect to
also share source and they will need to perform an exhaustive review.

Happy hacking!
-c

Sent from my iPhone

> --
> You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
> To post to this group, send email to chromium-...@chromium.org.
> To unsubscribe from this group, send email to chromium-extens...@chromium.org.
> For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
>

anjana paulose

unread,
Feb 16, 2012, 11:57:47 PM2/16/12
to Chromium-extensions
Hi,

.
After reading tutorials it seems that using chrome/pepper apis , i can
get access to only a separated area in file system, not anywhere i
want.

Typically my FF and IE extensions call MSDN functions to open and
select folders, extract icons from dll etc
Can i do the same thing with C++ wriiten for chrome extensions?

thanks
Anjana

anjana paulose

unread,
Feb 17, 2012, 12:47:05 AM2/17/12
to Chromium-extensions
Does this mean that from my C++ code, I can call a MSDN method
(provided i include the required libraries to compile) say,
SHGetFolderLocation to open a window in my web page, to select a file
or folder from the local file system ? From tutorials and materials
available, it seems that chrome itself does not give such a function,
which i can use to get to my file system in window or linux.

Am confused with this notion of passing only messages between a web
page and extension.


On Feb 17, 9:57 am, Chris Hughes <christopher.hug...@gmail.com> wrote:
> You would put the nacl in the extension background page and use the
> messaging API to interact with the pages. One option is using content
> scripts and passing messages to the background page that brokers
> messages to the nacl bits.
>
> Note that with nacl there are some limitations with respect to things
> like raw sockets. You can use the npapi API to get around that but be
> forwarned if you want to put  it in the chrome web store, expect to
> also share source and they will need to perform an exhaustive review.
>
> Happy hacking!
> -c
>
> Sent from my iPhone
>
> On Feb 16, 2012, at 12:47 PM, anjana paulose <anjanapaul...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I have an existing extension for IE and FF, used to upload a directory/
> > multiple files  from Windows or Linux.
> > This is achieved using C++ (ActiveX/XPCOM ).
> > My extension also has capability to extract icons from dll or exe in
> > windows.
>
> > 1.Can i use NaCl in chrome to achieve the same?Using javascript in my
> > code, can i invoke C++ method to do the things.
> > 2.Is it always necessary to have html file as part of extension to
> > hold the<embed > tag for nacl-module, or can i add it in my own page?
>
> > Please help
> > anjana
>
> > --
> > You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to chromium-extensions+unsubscr...@chromium.org.

anjana paulose

unread,
Feb 22, 2012, 4:46:43 AM2/22/12
to Chromium-extensions
Hi ,

I could make it work using npapi plugin created using firebreath. then
i used content script to programmatically inject the plugin to my web
page. Its working.

thanks
Anjana

Mohamed Mansour

unread,
Feb 22, 2012, 12:32:21 PM2/22/12
to anjana paulose, Chromium-extensions
I am just wondering, any reason why not to use the HTML5 File System APIs? You could upload a list of files to the client side from any directory, but the user must initiate such action by selecting all the files. 

If you want to do it automatically with no user intervention, the only way to do this is through NPAPI.

Kind regards,
Mohamed Mansour



To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

anjana paulose

unread,
Feb 23, 2012, 5:06:21 AM2/23/12
to Chromium-extensions
Thanks for your response.
Yes, I have a requirement to upload a directory as such even if its
empty. So i guess only npapi is the option.

thanks
Anjana

On Feb 22, 10:32 pm, Mohamed Mansour <m...@chromium.org> wrote:
> I am just wondering, any reason why not to use the HTML5 File System APIs?
> You could upload a list of files to the client side from any directory, but
> the user must initiate such action by selecting all the files.
>
> If you want to do it automatically with no user intervention, the only way
> to do this is through NPAPI.
>
> Kind regards,
> Mohamed Mansour
>

aristidesfl

unread,
May 9, 2014, 8:29:06 PM5/9/14
to chromium-...@chromium.org

chrome.fileSystem seems like a good alternative, but when I try to use it: "'fileSystem' is only allowed for packaged apps, but this is a extension."

So.. why is this API not available for extensions?
Is there any other alternative?

Cheers
Reply all
Reply to author
Forward
0 new messages