Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Upload contains full local path of the user
Message
 
À
15/11/2011 14:26:04
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01528948
Message ID:
01529159
Vues:
45
Could be anything really. The client determines what comes up for the file name so the browser - or more likely some library or spambot is using a custom Http encoder to try and send you a file and they have the full filename in there.

If you need to clean up the filename just use Path.FileName() to extract just the path.

+++ Rick ---


>I have never seen this before. My upload class has served over 25,000 uploads so far and this is a first. I have this code:
>
>
>            Dim lcControl As String = ""
>            Dim lcFileName As String = ""
>            Dim lnFileSize As Integer = 0
>            Dim loFileUpload As System.Web.UI.WebControls.FileUpload = New System.Web.UI.WebControls.FileUpload
>            Dim loHttpPostedFile As System.Web.HttpPostedFile = Nothing
>
>                ' Get a reference to the control
>                loFileUpload = oProcess.oPage.FindControl(lcControl + "$FileUpload")
>
>                ' If the file was uploaded
>                If Not loFileUpload Is Nothing Then
>
>                    ' Get a reference to the posted file
>                    loHttpPostedFile = loFileUpload.PostedFile
>
>                    ' See if the file was submitted
>                    If Not loHttpPostedFile Is Nothing Then
>
>                        ' Get the file size
>                        lnFileSize = loHttpPostedFile.ContentLength
>
>                        ' If the file was submitted
>                        If lnFileSize > 0 Then
>
>                            ' Get the file name
>                            lcFileName = loHttpPostedFile.FileName
>
>
>lcFileName usually gives the file name. But, in a particular case, I end up with something like this:
>
>"C:\Users\UserHere\Desktop\data file - drp - english - on.pdf"
>
>What is causing this?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform