Dear friends
I have a console application in which i want to first sign in and then I press button which directs me to file upload form .In file upload form I want to upload a csv file and then redirect to next form after clicking submit button then i want to get response of that form .
can any one help me to do this from C# console application?
thanks.
if you want to upload a file on a website from a console application,
then you should have information about FTP credentials.
If you want to do a real http-transfer you need to create a http request, I looked around a little bit and found this: Upload files with HTTPWebrequest (multipart/form-data), seems to be right. I'm doing something similar in python currently.
Related
I am uploading large files to server about 4-5 GB. I have currently used HTML 5 and javascript var reader = new FileReader(); to upload the file payload chunk by chunk to the action method and it will write to the file.
Problem with current uploading is if the user navigate to another tab in application or accidentally close the browser, file upload will stop because it's getting chunk using javascript on page. My requirement is also just upload and forget some background task will upload it for you.
I need some background thread that handle the file upload and upload the file in background. Like file upload queue. So if the user navigate to other page the file upload won't stop and continue in background.
Is this possible with web application? I did my research and found that thread is not a good idea on IIS, instead windows service should be used. But don't know how to do this.
I am not a pro so any idea/example will be helpful. Thanks.
i just wanna upload afile from a fixed path, so i dont want browse button, I need just a TextBox(Path of my file some thing like c:/junk/upload) and and upload button.some thing like
[TextBox.Path][UploadButton]
or can i get the code in java applets or any other lanaguage?
For security reasons, a webpage loaded in a browser from internet cannot directly refer the local file system. You need a desktop application or plugin to achieve this.
no we can make using asp.net or java applets and yes what you said is right, security reasons! , but every applications has a sand box limits and thats include file handling as default , and we achived that. with out problem
I need to automate downloading of a file from this site http://stats.smith.com/reports/Default.aspx using C#. The problem is that a web-form needs to be submitted first then the download takes place immediately. I can simulate the web form submit and the buttom clicks. However, once the form is submitted I don't know how to capture requested file. There is no redirection to the uri of the downloaded file. If there was I would have used function download(uri, filename) in webclient or webbrowser.
If you use the WebRequest Class you can receive the response and save it as a file.
I have a page that downloads a large HTML file from another domain then serve it to the user. The file is around 100k - 10MB and usually takes about 5min. What was think about doing something like this to make the user experience better.
download file
if file is not download within 10 seconds then displays a page that tells the user that the file is being downloaded
if the server completes the download in 1 second then it will serve the downloaded html
can this be done? do I need to use the async feature?
Updated question: the downloaded file is a html file
In order to provide an 'asynchronous' file download try a trick that Google is using: Create a hidden iframe and set it's source to the file you want to download. You can then still run javascript on your original page while the file is being downloaded through the iframe.
I think you should:
Return an HTML page to the user straight away, to tell them the transfer has started.
Start the download from the other domain in a separate process on your server.
Have the HTML from step 1 repeatedly reload, so you can check if the download has completed already, and possibly give an ETA or update to the user.
Return a link to the user when the initial transfer is complete.
It sounds like you need to use a waiting page that refreshes itself every so often and displays the status of your download. The download can be run on a separate thread using a System.Threading.Task, for instance.
I have a SWFUpload on my page, I click the button and the file selct window comes up, I select a file but I do not know how to get the filename that was uploaded? and I dont even know if the file is being uploaded.
Can anyone help me please?
I am using ASP.NET VS2010
I am currently working on swfupload but in java. I may be able to answer your question.
So after you select a file, the flash upload will prepare your files for upload. It will send the request to the upload_url. This call to upload_url is like sending a request with a
< input type="file" name="Filedata"/ > so you can access your file if you get the Filedata after the multipart post. In other words, its just like an html page uploading your files.
Let me know if you need more help.