|
-
May 29th, 2007, 05:28 AM
#1
Thread Starter
Lively Member
Upload of a file to server
Friends,
I want to upload document file from local pc to server pc(IIS server). I am working in a domain. I am unable to do the job.
For your help I use System.IO.File.Copy() function.
When I am using local path like
C:\Folder_Name\File_Name.pdf it is working fine.
But When I am using
\\PC-4\Folder_Name\File_Name.pdf it is not working.
Please help me. I need urgently.
Rajib
Please Rate every reply if it is useful to u
-
May 29th, 2007, 05:39 AM
#2
Re: Upload of a file to server
What error message does it show? And do you access to the Folder that you mentioned? File.Copy() should work properly if you have access to the specified folder.
In case you want to upload a File to a Web Server then you should take a look at UploadFile method of System.Net.WebClient class
Use [code] source code here[/code] tags when you post source code.
My Articles
-
May 29th, 2007, 06:05 AM
#3
Thread Starter
Lively Member
Re: Upload of a file to server
Thanks for ur quick response.
Yes, I have full access to the folder. But still it is not working.
Actually from my local PC it is accessing C:\...... correctly
But it is not getting \\PC-4\................
How can I write the address of the server?
-Rajib
Please Rate every reply if it is useful to u
-
May 29th, 2007, 09:37 AM
#4
Re: Upload of a file to server
Can you post the code that you are using? And is this share mapped on your PC?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
May 30th, 2007, 10:35 AM
#5
Re: Upload of a file to server
Is your application using identity impersonation? If not, then you need to grant the ASP.NET Worker Process permissions on that folder.
Go to PC-4, and grant full permissions to YOURMACHINE\ASPNET on that folder.
-
May 31st, 2007, 03:33 AM
#6
Thread Starter
Lively Member
Re: Upload of a file to server
Now I can copy files from my PC to server/Another PC successfully by using ASP.NET
Now problem is file dependent. For example, A.pdf is working but B.pdf is not working. Do I need anything in the files. If u have any clu please help me.
Rajib
Please Rate every reply if it is useful to u
-
Jun 4th, 2007, 06:39 AM
#7
Re: Upload of a file to server
-
Jun 4th, 2007, 11:44 PM
#8
Thread Starter
Lively Member
Re: Upload of a file to server
Mendhak,
Actually when I try to upload from my form. It is running well. But when I go the directory where the files are uploaded, I found that some files are there and some files were lost that means those are not in the folder.
I have found a clu. If I tried to load a scanned file, it is not uploding correctly. But If I upload a real PDF file it is working well. May be it can be a reason. If u have any clu please help me.
Rajib
Please Rate every reply if it is useful to u
-
Jun 5th, 2007, 01:22 PM
#9
Re: Upload of a file to server
I may not have a "clu" but I might have a clue.
I don't know the difference between your scanned files and 'real' PDF files, but go into debug mode. Set a breakpoint in the method which handles the uploaded file and step through it. Make sure you are catching exceptions. You may also want to do quickwatches on the uploaded file to see if its size is 0.
-
Jun 6th, 2007, 08:23 AM
#10
Member
Re: Upload of a file to server
You should also check the size of the scanned file you are uploading. If it exceeds the default 4Megs, the server will not allow the file to be uploaded.
-
Jun 7th, 2007, 03:00 PM
#11
Re: Upload of a file to server
Good call, I forgot about that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|