upload file to server in a particular path - apache-flex

In Flex i want to upload a particular file to server form local system.how to do it?
Thanks.

You cannot upload a file without using FileReference.browse() followed by an upload(). If it was possible, that would mean that a webpage can read any file from the user's machine without his knowledge or consent.
Can you even imagine the consequences of that?

You can upload byteArrays though if you are sending some images or texts. http://developer.amazonwebservices.com/connect/thread.jspa?messageID=76422

Related

How to auto-upload files to a server from a local directory in ASP.NET

I am trying to upload an image from my computer to hosting server using ASP.NET code, but I don't know if it's possible.
If it is, can you help me?
Sure it's possible. Read up on how the FileUpload class works: https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.fileupload?view=netframework-4.8
It won't be an automatic upload like you ask in the title, but you will be able to send files thru the browser and wherever you want them to go.

ASP.Net web application cannot read a file within folder

In my asp.net web application, I read the xml file for obtaining a key. If file is not present I show a form to enter the key details and then create the file.
First problem: My app does not recognize the file even if its there.
Second problem: I am running application on the server. When writing, rather overwriting the file, browser shows the username, password prompt before writing the file. If I enter admin credentials it allows to create a file.
I have checked all possible combinations of permissions on the file / folders, but could not resolve the problem.
Any ideas, what I could be missing here?
You read the xml file but is it as a part of your solution? If yes, are you reading it through relative path i.e. are you using Server.MapPath to read it like Server.MapPath("~/Files.test.xml")? Once you use relative path, I don't think it will ask you credentials as it still is in your project directory.
It should work. I am also reading and writing files in my web application.
If it still does not work, please tell me the way you are reading file.
Thanks,

How to Get complete file path using file upload control in asp.net or any other way?

I want to get complete file path using file upload control. I want to use them to get all the files from that directory.
Thanks.
You can't do this. If you could it would be a huge security hole and a risk to every user everywhere.

Physical Path for image saving. Asp.net

I have a web project and I saved my images in Physical folders in hdd Like d:\SecretImages\Imagename. But I can't open the files when I have to?
I thought if it can saves for examle d:\SecretImages\Temp.jpg, I can open when I have to but, I can't.
Help me please, thanks
You cannot use file paths to show your images. The browser doesn't know where to find the images and the server wouldn't serve them up anyway due to security concerns.
You could/should use an HttpHandler to show the images.
I answered a similar question here on SO how to do this.
its becus when iis get file, it get as ASP.NET user not local system user. just go to the folder and add IIS_IURS group to permission list. or just set folder accessible by everyone.
this type of problem mostly not occur when local debugging. but will happen in production or network storage.
Try this article
http://www.aspsnippets.com/Articles/Display-Images-in-GridView-Control-using-the-path-stored-in-SQL-Server-database.aspx

WMP: streaming, then saving

I use the Windows Media Player Control (WMP.DLL) in my application to download (stream) and show videos. Once the video file is fully downloaded, I would like to save it to disk. Unfortunately I can't find a way to do so. I thought of using a hack: probably WMP does not hold the whole file in memory, so it must be somewhere on disk as temp file - but where?
So, in short: does anybody know how to tell WMP control to save a streamed video to disk? (The Windows Media Player knows how to to it, it has a 'Save as' command, so there must be a way to do it.)
Thanks,
Jo
A workaround might be to check the temporary internet files folder - the file might be there.
That did it, thanks! I don't even have to search for the files manually , I can use URLDownloadToFile. If Windows finds the file in Temporary Internet Files, it just takes it from there instead of downloading it again. Problem solved!

Resources