I'm using Request.Files to obtain a file that the user is uploading on my web page.I noticed that if I use the filename property in IIS it gives me a path + filename, however if I run in cassini it only gives me the filename no matter what directory I use.Why is this? And, is there a way to just use the filename when in IIS?
Just to test, I created a blank website and a blank web site project.
When I added a referece to web site by doing right click and add reference it added the dll inside a BIN folder but on ther other hand when I did the same for a web site project it created a reference folder for me and then added the dll under the reference folder.
My application separates users by company identifiers in the URL: company1.app.com, company2.app.com...I am testing on my local PC with a request such as: company1.localhost.com. However, my request.Url.Authority still shows "localhost.com" instead of "company1.localhost.com". In fact, the prefix of 'company1' does not show anywhere. Is this a bug or a feature?
It's worth noting that I added to the host file an entry for "comapany.Blah -> 127.0.0.1". When looking at Request.Url.Authority it STIL shows localhost...
I ahve a gridview and itemtemplate in which I have an URL field from the database. When I clicl on this URL, it should open in another browser the URL that we clicked on.
I have an ASP.NET project (VS2008 on Windows 7 with either webforms, MVC1, or MVC2 -- all the same result for me) which is just the File->New hello world web project. It's using the default ASP.NET development server, and when I start the server with F5, the browser never connects and I get a timeout. I tried to debug this by telnetting to the development server's port while it was running, and I got the same result:
C:Usersfarmercs>telnet localhost 54752 Connecting To localhost...Could not open connection to the host, on port 54752: Connect failed I can see in the system tray that the server thinks it's running, and a netstat -a -n command shows that there is indeed an active TCP listener on that port.
This worked in the not-too-distant past, and I could work on web projects using the development server. One thing that has changed since then was that I installed the Microsoft Loopback Adapter to accommodate a local development Oracle installation. I'm not sure this is the problem, but it seems a likely culprit.
I also tried to hit the port using the server name itself (http://mycomputername:54752) but with the same result. So, what could be blocking me from connecting? And if it's the loopback, then what is a good way for me to retain my ability to connect to my development Oracle server while still being able to use the ASP.NET development server?
I'm going to be in a situation where I'll have www.DomainA.com and www.DomainB.com, each having seperate IPs. All requests to www.DomainB.com/{Path}, I'd like to redirect to www.DomainA.com/{Path}.
My initial reaction was, in the base directory, to simply create a HTTPModule and Web.config to add in the module, where the module would then redirect the request to DomainA.
The only problem with this is IIS is not executing the module, and instead determining itself whether or not there is a matching file or application to run based upon the requested path (i.e. so you'll either get an error about the requested file not existing, or a security error about not finding the requested application).
What do I need to change in IIS to always run my module? Or is there any easier way to do this using .Net 2.0 & IIS6?
[Update : I have inserted this post in "XML Web Services" section by mistake, so if you are a moderator or Admin, please shift it to "Security" section or any other relevant section]
I am working with WCF REST Service Application in .Net 4.0 and my service is hosted on II7 (Windows 7 Ultimate - 64 bit).My service and all other code is working completely fine.But when I use the '&' character in request url, it shows the following Error.I have already tried adding following section in my web.config as shown here on www.asp.net
I am using Webhandler to upload images to the server. I want to send the folder name so on that folder the images will save. I am using this URI format and got the below error.
Also I added the following line in the web.config but still having the issue.
<httpRuntime requestValidationMode="2.0" />
A potentially dangerous Request.Path value was detected from the client (?). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (?).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: [HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (?).] System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +8884233 System.Web.ValidateRequestExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +35 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Version
Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
I need to download files from server through code. The files are located under the server's C://DownloadFiles/*.txt, but i dont want to give hardcoded path in the code. My query is can we use Server.MapPath here, if yes what will be the syntax for this.
Is the Content folder the root folder? I mean does http://localhost/ point to Content or is it something else?
I have a file named dummyIcon.png inside Content/images/temp folder. How do I locate it from my domain layer (which is a Code Library project)? What is the best practice of displaying images in ASP.NET MVC? Should I store a path to the image in the database (which I personally prefer), or do I save a byte array and return it to the view?
I've got a project that's going to go on a dedicated server environment. I'll be uploading images to the server, but saving them outside of the virtual folder path of the actual website, like so:
Now, this works fine on my home computer. Is there anything I'll need to do with IIS or ASP.NET (possibly in web.config) for this to work properly on a production machine? Settings or permissions that may need changing?...
It will be on Window 2003 with IIS6 and ASP.NET 3.5 SP1.
I have a directory that holds some images for my site. I have noticed that if i put in the my web sites address followed by "/directoryname/imagename.jpg"
it displays the image i have in that directory. Is there anyway to disable this or stop this from happening? so that the images can not be displayed like this
Dim myDataset As New DataSet() Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Request.ServerVariables("APPL_PHYSICAL_PATH") & "dynamicuploadedLists" & strFileName & ";" & _ "Extended Properties=""text;HDR=Yes;FMT=Delimited(,)"";"
''You must use the $ after the object you reference in the spreadsheet
Dim myData As New OleDbDataAdapter("SELECT * FROM [" & table & "$]", strConn) 'myData.TableMappings.Add("Table", "ExcelTest") myData.Fill(myDataset)
And I am getting the error , while the path is correct.
'E:missitenamedynamicuploadedListsSheet1.csv' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
The component works fine in a windows app, but when I tried to use it in an asp.net website, it fails as the site could not find the data files. And it gives me the following error:
C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filescmictranslatorsite20a8eddd864b2575assemblydl35bd4a35e8c6f79b6_98eccb01datafile.txt
I am trying to put together a page where files uploaded by a specific users would be listed in a bulletedlist and I am stuck. Here's the rundown:
Users login, they upload files which are saved to disk in the user's own directory. All the file's information, including the path, is stored in a SQL database.
The user has also its own page, where there is a bulletedlist (set as a hyperlink) that gets the filename from the SQL. However, the path to the file is incomplete.
The file is saved to the site's directory structure: C:WebsitesSiteUploadsUserFile.pdf. However, the hyperlink shows[URL]
Can anyone point me to the right direction? Below is a snippet of the upload method and the retrieval to build the bulletedlist.
I want to save three images path in table also upload images in folder,how it is possible?[Using ajax file upload control]table columns are imagepath1,imagepath2,imagepath3. URL....
Given a set of uploaded files in Request.Files, how do figure out which form field yielded which file?
I have a generic form emailer that various forms post to. This file generates an email of the name/value pairs contained in the form post. I'm trying to add support for uploaded files such that the table of name/value pairs will show the name of the file upload element and the name that the file was saved as.
However, I can't figure out how to link that information together. HttpPostedFile doesn't contain any information about the HTTP request (like which field name was used), and Request.Form doesn't contain any entries for uploaded files.
So while I can easily upload the files, I don't have an easy way to generate an email saying "this uploaded file was for this field, and this uploaded file was for that field".
I'm using the new Aurigma Image Uploader Flash control, and creating sample pages works great. However, when I drop this control onto an existing page on my existing site, it doesn't work. I can only suspect something in the masterpage or something else on the page is messing with it.
We have page that allows the users to upload documents (multiple). When the upload takes a long time - either due to the size of the files or due to slow upload speeds - we get a exception saying "Request timed out".
We found that the exception is thrown as soon as the upload is complete. So we have modified the executionTimeout config entry to 6000 secs. But this error still shows up consistently. We are running IIS6, .net 3.5 sp1 (asp .net 2.0).
Update.I'm able to reproduce this issue with relatively small files (multiple files with total of 75MB)