|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I am using aspSmartUpload to upload images, but the files are not getting saved. No error is generated (I am not using On Error Resume Next). Can anybody tell me what the problem might be? It is a mixed form, and I can access all variables (even the file size and name is shown correctly). I tried their sample app, I have the same problem there. I need to get this to work really quickly. Any help will be greatly appreciated. Thanks in advance ![]() |
|
#2
|
||||
|
||||
|
Are you sure that there is no file involved in the application that is using On Error Resume Next. Failing this, sounds like the files are being saved in a directory other than the one you are expecting
__________________
selwonk If I've posted some code above, you might think it looks a bit simplistic. It might be. I'd rather people tried the next step themselves rather than getting a full solution on a plate. That way they learn more! |
|
#3
|
|||
|
|||
|
There is code that uses On Error Resume next, however, my upload & save file code is in a sub of its own (and does raise errors for things like, when a file with a disallowed extension is selected).
As for the files getting saved elsewhere - I did a response.write for the path I am saving it to, and it seems fine. I did check the wwwroot directory, nothing's getting saved there, I don't know where else it could get saved. I am using PWS on Windows 98, could that have anything to do with it? (I think it should not )Edit: I did a find on my machine, there is no file with the name I specified when using saveas. |
|
#4
|
|||
|
|||
|
hi,
Make sure you have give full permission to the directory where you are saving the image. from windows explorer -> right click on that directory and select properties -> from there give full permission on web sharing : share this folder and then try if it gets saved. Also try this way if not mySmartUpload.Files.Item(1).IsMissing Then mySmartUpload.Files.Item(1).SaveAs("/path/" & filename) end if in the above give appropriate path and filename regards skpshah |
|
#5
|
|||
|
|||
|
I tried both your suggestions, it's still not working!!
I can't find anything wrong with the code (as mentioned, even their sample app is not working)Could it be because the client and server are the same machine?? |
|
#6
|
||||
|
||||
|
If you have any On Error Resume Next comment them out. You can upload from one PC to the same PC. It definately sounds like the error is being suppressed somewhere
|
|
#7
|
||||
|
||||
|
my advice: dump the asp"smart"upload in the nearest dumpster and get Pure ASP Upload code somewhere - I also made the mistake of using that component in my early days, got into tons of problems, and ever since I use the Pure ASP Upload code all is working smooth.
|
|
#8
|
|||
|
|||
|
send your code, then maybe I can see whats the problem.
regards skpshah Quote:
|
|
#9
|
|||
|
|||
|
Here's the code:
Function uploadFile(mySmartUpload,virtFilePath) Dim intCount,file virtFilePath = "pics/filename." mySmartUpload.DenyPhysicalPath = False mySmartUpload.AllowedFilesList = "gif,jpg,jpeg" mySmartUpload.MaxFileSize = 500000 mySmartUpload.TotalMaxFileSize = mySmartUpload.MaxFileSize mySmartUpload.Upload virtFilePath = virtFilePath & mySmartUpload.Files.Item(1).FileExt If mySmartUpload.Files.Item(1).IsMissing Then Response.Write "File not specified" Else response.write "path: "&Server.MapPath(virtFilePath)&" ...totbytes="&mySmartUpload.Files.TotalBytes&" ...numfiles="&mySmartUpload.Files.Count mySmartUpload.Files.Item(1).SaveAs(Server.MapPath( virtFilePath)) End If If Err.Number <> 0 Then handleError "photo upload error - "&Err.description, 1 uploadFile = virtFilePath End Function 'uploadFile |
|
#10
|
|||
|
|||
|
Thanks for the tip, I'll have a look at that
![]() Quote:
|
|
#11
|
||||
|
||||
|
try this instead of the last line:
If Err.Number <> 0 Then Response.Write("error occured: "&Err.description&"<br />") End If maybe there is no such function as handleError. |
|
#12
|
|||
|
|||
|
Oh, sorry, that's my own error handling function. It simply redirects to my error page,which is not happening, so I know no error is raised.
Quote:
|
|
#13
|
||||
|
||||
|
so we're back in stage #1. as far as I know, that component you have is toally useless and simply does not work - my suggestion of using pure ASP upload stay my best advise then.
|
|
#14
|
|||
|
|||
|
Quote:
Hi, I took your advice, and it's finally uploading!! Thanks ![]() |