error reading file

Hi ,

     Am facing a sever problem in opening SW2011 *.dwg file which is downloaded from a local server. It throws "Error reading file" msg when i try to open the file.

But when i open the file directly in the server folder it opens in SW2011. AM using aspsmartupload too to download the *.dwg file from the server.

Am not aware much of Solidworks software. Am a software developer, i developed an asp application in which i use aspsmartupload tool to donwload the SW files from the server.

Doesnt matter what the file format is ,  i receive different error messages when i open different file formats from the server. While downloading it seems like the file is chnaged to an invalid format. is there anything that aspsmartuplaod tool not supported to download and open SW2011 file. If so which tool can be used to download the SW2011 files. Or any SP for SW2011 is has to run to fix this issue.

Did anyone faced such an issue and got fixed?. Please help me with some ideas.

I tried with this many a times but couldnt find any solution. Please some one help me to slove this issue. The server has windows 2003 and SW2011 installed.

Its very urgent.

Thanks in advance,

Bala.

SolidworksApi macros
Answers 7
BL
BL 2011-04-26 Best Answer

Hi,

I am not fimiliar with aspsmartupload (Are you still using Classic ASP???).

Can you upload the working DWG file?

-Bnaya Livne

US
US 2011-04-26

Hi , Thanks for the reply.

Yes  am using classic asp. I use SW API program in VB to open the SW 2D drawing file and saving it as *.dwg in one of the folder in the server. The same file when downloaded through asp application is not openning. But i can open the file from the saved location in server.

Attached the working file.

Thanks,

Bala.

BL
BL 2011-04-26

I am not sure about how the aspsmartupload works but if you open the two dwg files in text editor (not Notepad, Notepad++ is good) you can see that the first line of it is the only different. I supposed that it because bad headers that the asp send to download that file. Do you send the headers in the downloading process?

Bnaya

US
US 2011-04-27

Hi Bnaya,

     Sorry, i dont undersand what header you talking about.

     I dont send any headers to download the files. I just send only the  filename with the path, the source code is as given below for your reference,

   Dim MyDownload
   Set MyDownload = Server.CreateObject("AspSmartUpLoad.SmartUpLoad")
   MyDownload.DownloadFile strDownloadFile
   Set MyDownload = Nothing

here variable "strDownloadFile" contains the value as D:\Pacdor\pacdor_processor\cache\dwg_0\40302x1x10125Lb143-5TTEFC.dwg

May be you are correct even i dont know how the aspsmartupload tool works to download a file from a server windows 2003.

Bala.

US
US 2011-04-27

Hi Bnaya,

    Thank you so much . Your findings helped me to fix the issue. Actually the problem seems to be with the aspsmartupload. Setting one of the the property  "DownloadBlockSize " of aspsmartupload to max size has fixed the issue. This property determins how much data can be read from the datasource at one time. But am not 100% sure that this caused the error or something else. anyways the issue is fixed for time being.

Thanks,

Bala.

BL
BL 2011-04-27

Hey,

I am happy to hear that.

The headers that I was talking about are the HTTP headers that the ASP application send to the user's browser. That can cause troubles :-)

Anyways I am happy you solved it.

-Bnaya Livne

US
US 2011-04-27

ohh. okie. Thank you.

Bala.