30. august 2001 - 20:50Der er
4 kommentarer og 1 løsning
Upload uden komponent + sti i DB???
Fedt nok med \"Upload uden komponent\" det virker bare..!
Men hvordan for jeg skrevet stien i min database? Og hvordan afkorter jeg stien i databasen fra fx. C:/safasdf/asdfasdf/asdf/asdf/asd/fasdf/picture.jpg til fx. /upload/picture.jpg???
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
Dette kan lave pathen om: picturePath = \"C:/adf/adfa/adsf/picture.jpg\" filestartPos = InstrRev(picturePath,\"/\") if filestartPos > 0 then picturePath = Right(picturePath,len(picturePath)-filestartPos) picturePath = \"/upload/\" & picturePath end if Response.write picturePath
Jeg bruger nu en anden upload uden komp. Den afkorter selv filnavnet... jeg tror det er dette her:
\'Separetes file name from the full path of file Function GetFileName(FullPath) Dim Pos, PosF PosF = 0 For Pos = Len(FullPath) To 1 Step -1 Select Case Mid(FullPath, Pos, 1) Case \"/\", \"\\\": PosF = Pos + 1: Pos = 0 End Select Next If PosF = 0 Then PosF = 1 GetFileName = Mid(FullPath, PosF) End Function
Jeg regner med at funktionen gør hvad den skal bare uden at sætte /upload/ ind foran filnavnet så det har jeg lagt ind. Så må den komme til at se sådan ud:
\'Separetes file name from the full path of file Function GetFileName(FullPath) Dim Pos, PosF PosF = 0 For Pos = Len(FullPath) To 1 Step -1 Select Case Mid(FullPath, Pos, 1) Case \"/\", \"\\\": PosF = Pos + 1: Pos = 0 End Select Next If PosF = 0 Then PosF = 1 GetFileName = \"/upload/\" & Mid(FullPath, PosF) End Function
\'Separetes file name from the full path of file Function GetFileName(FullPath) Dim Pos, PosF, imagePath PosF = 0 For Pos = Len(FullPath) To 1 Step -1 Select Case Mid(FullPath, Pos, 1) Case \"/\", \"\\\": PosF = Pos + 1: Pos = 0 End Select Next If PosF = 0 Then PosF = 1 imagePath = \"/upload/\" & Mid(FullPath, PosF) GetFileName = imagePath End Function
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.