Hi,

This is a porting problem in Wt. While Unices make no difference
between binary and text files, windows still does. Therefore, we must
open our files in binary mode in order to avoid all kinds of
conversions to happen. To fix this problem, go to CgiParser.C, find
the line that looks like this:
      spoolStream_ = new std::ofstream(spool);
and replace it by:
      spoolStream_ = new std::ofstream(spool, std::ios::out | std::ios::binary);
Then recompile Wt.

This fix will be in our next release. Thank you for reporting this.

Regards,
Wim.

2008/5/13 Silly & Chrischi <[EMAIL PROTECTED]>:
>
>
>
>
> Hello guys,
>
>
>
> under Windows XP we have problems using the WFileUpload. The file, if there
> is no text only file, is greater than the original and can't be open. What
> ist he problem we have?
>
> We work with witty 2.0.6.
>
>
>
> Here is our code:
>
>
>
> Designer:
>
> materialField_ = new WFileUpload();
>
> materialField_->setStyleClass("field");
>
> editDialog_->contents()->addWidget(materialField_);
>
> editDialog_->contents()->addWidget(new WText("<br/>"));,
>
>
>
> Uploader:
>
> void CourseManagementGUI::newMaterialUpload() {
>
>         materialCounter_ = 0;
>
>         if (!materialField_->isUploaded()) {
>
>                    materialField_->upload();
>
>         }
>
>
>
>         materialField_->uploaded.connect(SLOT(this,
> CourseManagementGUI::newMaterial));
>
>
> materialField_->fileTooLarge.connect(SLOT(this,CourseManagementGUI::errorFileSize));
>
> }
>
>
>
> Worker:
>
> if (!materialField_->emptyFileName() ) {
>
>           std:tring spooledFile = materialField_->spoolFileName();
>
>           std:tring uploadFile = configData_.getUploadStorage() +
> materialField_->spoolFileName();
>
>           std:tring fileName = materialField_->clientFileName().toUTF8();
>
>           boost::filesystem::copy_file(spooledFile, uploadFile);
>
> }
>
>
>
> Thanks.
> -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
>  witty-interest mailing list
>  [email protected]
>  https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to