[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

select file from HD

Is it possible to select a file path from a swf-file? It would have to work the same way the <input type = file > tag works in HTML. You click on a "select file"-button in a swf and a dialog-window pops up. After you select a file, the file-path gets passed on to a cgi (in order to upload a jpg for example to the server).

JavaScript, cgi and whatever needed is allowed - but I don't want a seperate HTML-window to have to pop up with a <form>-tag, "select file" and "submit"-button. The user-interface is flash!
0
99grad
Asked:
99grad
1 Solution
 
thor918Commented:
Hi 99grad, What you are asking of are possible only if you are going to use the project on your own computer. or a computer on the internett with low security settings.. (Internet explorer)
0
 
thor918Commented:
I don't think you are ever going to get an answer on this topic.. People has asked similar question and ended up with the simple answer that it is possible, but the user have to do something to get it to work.. and I don't think there are many users that wants to lower their security settings to use your flash..

To upload the file you have to use activex and that's microsoft explorer only(there are plugins to other browsers, but I have not checked them out).
0
 
thor918Commented:
I think your points for this question is very low..
50 points are what you get for an easy question!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
99gradAuthor Commented:
Thanx. But it seems that I'll have to use a HTML-form to get this problem solved. I don't want to force the user to lower his security settings... I'll leave the question online for a few more days to see if there are any other answers...
0
 
SuperMarioCommented:
One way to do this is to call an ASP script which gets all the files on the hard drive. Actually if you use a VBScript it will run on the client side, therefore allowing the user to browse HIS files, not the server files...

However you would have to call the script every time the user changes directories and that kind of stuff. It might not be that bad but there's a lot of programming involved and it might just be easier to use HTML and make it look nice with CSS.

There is no built-in function for this, if that's what you're looking for. You'd have to do a lot of scripting.
0
 
SuperMarioCommented:
Also you do not need activex to upload files, you only need a binary pure asp upload component which can be obtained for free on the net.
0
 
thor918Commented:
SuperMario, you lost me there. why are you saying that one way is to use asp? then the user have to download the asp file and have a webserver to execute it on.

Asp is server side anyway you see it.. it will need a webserver to execute.
0
 
SuperMarioCommented:
I'm assuming that the FLASH MOVIE would be on the internet, and thus it would reside on a web server, which would have ASP capabilities. The Flash movie could call the serverside ASP code and the user wouldn't have to touch the ASP... that's what ASP is for.
0
 
thor918Commented:
you cant see clients hd with asp.
0
 
thor918Commented:
and if you have manage to do so I would be very happy to see that
0
 
SuperMarioCommented:
no you can't see it with ASP. You can upload a file with ASP. The client can see his own HD with VBScript (see Scripting.FileSystemObject)
0
 
thor918Commented:
eeh supermario, the reason for me to say we needed an activex is that the 99grad said that he was going to use flash to upload the file.. and the only way to get that is to use a client side script to call the browse for file dialog. and when the file is selected we need to simulate the submit button.. but explorer does not allow this.. so therefor we need to get the filepath using the input field and client script and use an activex to upload the file.. but this requires extra security access.

offcource he needs a serverside script to handel the incomming files..
0
 
thor918Commented:
yes. with extra security access you can use filesystem object on client side.. but once that this is executed on the net, the user will have to lower their security
0
 
thor918Commented:
just try it yourself.. make the code that browses the clients hd using filesytem object..and try it on you computer.. it will look fine..
but once you upload it to the server and try to access it from the web it won't run unless you sett your browser to run unsecure activex..

filesystemobject is an activex you know!
0
 
thor918Commented:
99grad, have you been convinced?
If you want to upload you can call javascript to open a new window with file upload menu.this is the best way to do this.
0
 
thor918Commented:
If you want to upload you can call javascript to open a new window with an file upload menu inside.this is the
best way to do this.

to open a new window using javascript, paste this javascript code in the html page->
<script language="JavaScript"><!--
function newWindow(file,window) {
    msgWindow=open(file,window,'resizable=no,width=200,height=400');
    if (msgWindow.opener == null) msgWindow.opener = self;
}
//--></script>

then from flash you can setup an button ->
on (release) {
    getURL("javascript:newWindow(\'doc2.html\',\'window2\')");
}
0
 
OBCTCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept thor918's comment as answer.

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

OBCT
EE Cleanup Volunteer
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now