Creating Link To File On Web Server And Offer User To Download

Sep 6, 2011

I ran across some legacy code which creates a link to a file on the web server and offers the user a link to download the file.

Machine name:
MYSERVER
[URL]

Full url path to the directory containing the file to download: [URL]

Target file name:
downloadable.txt

The code does the following to create a link to 'downloadable.txt'
server.machinename.tostring & ".. argetdownloadable.txt"

Which results in:
"MYSERVER.. argetdownloadable.txt"

That link appears on the page as:
<a href="MYSERVER.. arget.downloadable.txt">download this file</a>

In IE 7, mousing over the link shows the full URL "[URL]" in the status bar. And it works fine for downloading the file in IE 7 (left or right-click). Firefox shows "[URL]" in the status bar and downloading the file isn't as straight forward. FF actually tries to change the file name to include the server name and target directory in the file name.

I've tried other methods like WebClient.DownloadFile() and had no success. This works, but I'm unfamiliar with the ".." and curious about how it works. I understand that ".." typically means go up one directory. My question was really more in the line of "how does that get interpreted in the browser to sort out the path?"

View 4 Replies


ADVERTISEMENT

Creating Download Link To A File On A File Server

Oct 11, 2011

I'm looking for a way to (easily, by preference ;)) create a download link to a file on a separate file server.The situation is as follows: the application I'm developing (asp.net 2.0 in vb.net but I have a similar issue in c#, either solution works for me) will be run internally for a company.As is good practice, the file storage and web application are on two separate servers.I basically need to be able to create a download link to a file, the only available URL i have to access the file is servernamefolder1folder2folder3file.txt (can be any sort of file)[code]Which doesn't work for obvious reasons. It used to be set up to write that file to the application path itself and that worked perfectly, but it isn't good practice and that's why I'm changing it (or trying to).I read solutions about creating a download page and then having a table in your DB which holds the links and returns the proper web URL for download but the time constraint I am faced with unfortunately doesn't allow me to develop that.

Assuming I can provide a string with the full filepath to the file like the above, what is the easiest way to just create a link that, when clicked, downloads the document? I have 0 admin rights in this environment. That really isn't helping me. Let's assume I am given the correct link like above and have the appropriate file access rights and such.The above example does work in IE, but not in Firefox and Chrome. IE converts it to a file://servername/... link which does what it's supposed to, but FF and Chrome both actively decided that this is unsafe and have disabled it from their browsers.

View 2 Replies

VS 2008 - Creating A Tycoon Game / Make The Player Either A 'job Offer' Or 'share Offer'?

Jul 24, 2009

I am creating a tycoon game where you start at the bottom and go up the business ladder. At the end of the year, the player can either, stay with him current job, get another job or go it alone. I would like to know how I can make the player either a 'job offer' or 'share offer' when they own their own business.

View 4 Replies

When User Clicks On A Download Link / Download Dialog Is Surpressed?

May 31, 2009

How do I make it so that when the user clicks on a download link, the download dialog is surpressed?

View 5 Replies

VS 2010 Make The Download Manager Know It Is Link To Downloadable File As Opposed To Something Like Link To Another Webpage?

Dec 4, 2010

I'm using visual basic 2010 express..I'm building my own web browser and want to add a download manager.I have been able to build one that will download a file if I type the file location into a text box.What I'm trying to figure out is how to have the download manager open when I click on a download link on a web page.How to make the download manager know it is a link to a downloadable file as opposed to something like a link to another webpage?

View 3 Replies

Make A Program That Allows The User To Type In The Download Link?

Jul 14, 2010

I'm planning to make a program that Allows the user to type in the Download Link of another program, and then Run it. I do not want the file to be saved on the user computer.

View 1 Replies

Creating A Web Application Which Is Going To Allow The User To Upload A Video File To The Server

Jun 7, 2010

I'm working on creating a web application which is going to allow the user to upload a video file to the server. Once the file is uploaded to the server, it's going to be converted to .flv and copied to another folder in the same directory. Since I'm doing this from a web app, I don't want to tie up the app with the conversion process. That is when I figured this might be a good time to try threading the conversion process... what do you think?

Currently, my process logic is this:

1) User presses the upload button.

2) A dummy record is created in the database for the file being uploaded.

3) Folders are created on the server to house the original video file and the converted video file.

4) The original is copied to the server.

5) Once the original is finished being copied, the app converts the original to .flv and saves it in another folder.

6) Information about the conversion process is stored in a .xml file

7) The dummy record is updated with real data

8) There is a redirect to a page that lets the user view the .flv file on the web

View 6 Replies

Save A File In XML And Offer The User A Save Dialog?

Feb 6, 2012

Im trying to save a file in XML and offer the user a save dialog to appear so they can name the file. The file will save using a custom file extention. The problem is I keep getting off the wall suggestions and Im looking for a simple solution. Here is what I have, please only show examples using my syntax based code. Im still a bit new to Vb so posting off the wall examples

[Code]...

View 10 Replies

Winforms Saving Images To SQL Server Without Creating A File On The User's Hard Drive?

Jun 22, 2011

This is my first attempt at creating a Winforms application, and I have been developing in the .Net Framework (Silverlight, ASP.Net, WPF) for about 6 months. So, my appologies if this is a newbie question.

Basically what I am doing right now is taking the drawings of a stylus-based input, and storing them into an image field in a SQL Server database. Then, in another form, I go and get that image out of the database, and load it into a picture box. It works, but it is rather "sloppy" how it got there.When the user clicks save, it stores that image into a temporary folder, then converts it to a byte array and throws it into the database that way. Then, it deletes the file from the temporary folder. When retrieving it, it pulls it out of the database in a byte array, then converts it to an image in a temporary folder, thus displaying it on the form.

Is there a way that I can just bypass the storing of the file onto the user's harddrive both times, and go from byte array to picturebox?

View 2 Replies

Download File From Http Server That Requires A Referral Before Allowing Download?

Nov 18, 2011

I usually download file using following code:My.Computer.Network.DownloadFile("url of the file","filepath to save the file")But recently I encountered a site that only allow file download if you click it from its site and not via direct downloading from vb.net code.How to download file from http server that requires a referral before allowing the download?

View 1 Replies

FTP Upload & Download & Creating A Folder On A FTP Server?

Jul 15, 2009

if anyone knows the code for ftp upload and download, folder creation and a good server that supports uploading and downloading files from a vb.net application.

View 1 Replies

Get Download Able File Link?

Sep 18, 2009

How to TextBox1 Pick text of "Download able" (.exe , rar) File link , during Navigation website. on my Own Webbrowser.i m using this method for downloading file! ineed solution of Pick Downloadable link

Dim webc As New System.Net.WebClient()
webc.DownloadFile(textbox1.text, textbox2.text)

[code].....

View 1 Replies

Get The Link In Datagridview And Download File 1 By 1?

Nov 15, 2011

how to get the link in datagridview and download the file 1 by 1? i'm newbie in programming..

View 3 Replies

Download File Using Progressbar From Each Link In Listbox?

Jun 6, 2011

is someone know how to download files from each link in listbox and using progressbar1 as size file downloaded..?

View 6 Replies

Get To A Webpage That Has A File Link To Download A File?

Jan 4, 2012

I am trying to automate file downloads. Sometimes I get to a webpage that has a file link to download a file, but it is not a direct link. Instead it is a PHP request on the server side, for the file.

Is it possible to automate this using the webbrowser control, or is there another way I can do this using VB .NET?

View 1 Replies

Download A File From Ftp Server?

Aug 3, 2011

How can i download a file from an ftp server, i can upload but i dont now how to download.and the ftp file is raw and raw = not on a download page just on the server

View 12 Replies

Download A File From Server?

May 17, 2012

I am making a project for my final year, asp.net with vb.net ( Beginner ). i upload the file using the fileupload control of asp.net on the server. Now how will the client be able to download that file?

View 1 Replies

Download File From Ftp Server?

Jul 8, 2010

I'm writing a program that requires me to download a file from a ftp server to my C directory. Is this possible in VB.net?

View 6 Replies

Error Download File From Ftp Server?

Feb 1, 2012

I got the fallowing error while debugging which i'm pasting the snapshot of that error.i just got the the code from internet to download file from ftp server.Below is my VB code

Imports System
Imports System.Data
Imports System.Math

[Code]....

View 3 Replies

Download A File From A Url And Have It Zip To A Specific User Defined File

Jun 15, 2010

im going get ot the point i just wanta download a file from a url and have it zip to a specific user defined fileurl so here is my fake code please put in vb 2008 language. [code]

View 1 Replies

Communications :: Download File From Apache Server?

Mar 23, 2010

I recently set up an apache server in a small computer (its an ALIX board) and i need to download some files that are going to be stored in that machine. The web server is running and I can create a file called "moo.txt" and if i go to the web browser I can see its contents Now, I need to create a vb.net application to communicate with this machine and download that file So far I have tried the following

Code:
Imports System.Net
Imports System.IO
Module Module1

[code]....

This gives me "error accessing site an exception occurred during a WebClient request"

View 1 Replies

Download The File Into The Server To Client System?

Feb 26, 2009

How I Can Download The File Into The Server To Client System In Vb.Net Appliction

View 1 Replies

Asp.net - Retrieve And Download Server Files (File.Exists And URL)

Sep 6, 2009

I have a database table where the user marks files to be downloaded. Subsequently, I browse this table and need to create a fileList to pass to an ActiveX downloader. My routine works locally and on the server for ONLY the first file. I know my logic must be bad, but I cannot find it. All of these files are always in the same server directory which is as follows:

"D:inetpubvhostsWebSite.comsessionVideos"
Sub (GetFileList)
Dim dtVideosSelected As New DataTable

[Code].....

View 2 Replies

Download A File From A Ftp Server In Visual Basic 2008?

Nov 6, 2009

Would it be something like this

My.Computer.Network.DownloadFile("ftp://My.Site.com")

View 2 Replies

Download File From A Web / Ftp Server (show Progress) And Execute It

Feb 7, 2006

I need to download an .exe from the web/ftp server and execute it. (it's a setup program)The application would use the WebClient (probably) class to downlad the files, and presumably would display progress to the user as it goes.

View 3 Replies

Download File From A Web/ftp Server (show Progress) And Execute It?

Sep 14, 2004

I need to download an .exe from the web/ftp server and execute it. (it's a setup program)The application would use the WebClient (probably) class to downlad the files, and presumably would display progress to the user as it goes.

View 1 Replies

Add User Agent Download String When Downloading A File

Apr 24, 2011

My.Computer.Network.DownloadFile _
("http://example/example.exe", _
"C:example.exe")

I'm using this code to download a file can I add User Agent String so protocol analyzers could have info about this download with a custom string I make.

View 3 Replies

Button Click To Download EXE Or Zip File From CD To User's Computer

Oct 21, 2009

I'm creating a CD that when inserted into a CD-Rom will AutoRun, which brings up the program starting with a splash screen, then the first window form. All this works, no problem. On the first window form I have a button (one of many) all buttons work (so far) except this one button. (I actually haven't test3d the buttonjs to see if they work on / from a CD yet, but they work in Debug).

I would like to have the user click the button, and have that button be tied to a zip file or an exe file that is in a folder on my CD, that will be downloaded to the user's computer. I would like the usual window to come up asking the user where the user would like to save the file, the user will choose the folder, click the save button and the file downloads from the CD to the hard drive of the user's computer, so the user can open it later. It doesn't have to Run from the CD, it is just to download to be accessed later.

Some files will be a Zip and others are Exe files that I would like to have downloaded to the user's PC by way of a button click. Of course the user's computer will need to be able to know which drive the CD is in.

This is what I've tried and doesn't seem to work...Have not tried it from directly from CD (Haven't tried anything directly from the CD as of yet, but after this problem my next step is try and make a AutoRun CD and test the program).

Process.Start(Application.StartupPath &
"SoftwareApp1.zip")

I'll start another post for How to Make my Program ready for a CD. I think it may involve Publishing...but publishing only made a setup.exe, which is Not what I want.

View 1 Replies

Download Dialog Box That Allow User To Open Or Save File

Jul 9, 2009

I have the following code that generates a csv file on a button click. [Code] What I want to do is open a download dialog box that will allow the user to open or save that file it has just created.

View 2 Replies

Store File Into Windows Application So User Can Download It?

Jan 30, 2011

I am creating a windows application using visual studio. I want somehow to insert an excel file into the application so the user will be able to download it from the program and save it to his computer. This means that the file will be a part of the program. There will be a button that will prompt the user to save the particular file somewhere so he can then view it.

What should I do in order to "embody" the excel file to the application? And what code should I write to link the file with the button?

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved