Latest News

  • Super Tower Defense Game
    Mar 10, 2010

    New to the games section is the new Super Tower Defense game. Defend your base from the ever advancing army of tanks, buggies...

  • New Rich Text Editor User Control
    Feb 19, 2010

    By popular request, here we present a re-usable User Control containing the Liquid RichTextBox along with the most common formatting functions included.

  • Silverlight 3 Controls V5.2.7 Released
    Feb 19, 2010

    This release includes several fixes for issues raised in the forum. The main improvement is to the RichTextBox which now provides access and methods to the document elements allowing...

  • Super Shoot Em Up Game
    Feb 04, 2010

    Added to the games section is the new Super Shoot 'Em Up game. Take control of a tank with your aim being to blow up your opposing tanks and collect all the powerups.

  • Silverlight 3 Controls V5.2.6 Released
    Feb 04, 2010

    This release includes some minor fixes for several forum posts. Please see the notes on the download page for full details on what has changed.

bvdd
bvdd
Files bigger than 32Kb Posted: Dec 19, 2009
 

Hi Dan,


I'm using your Fileupload-control in VB.NET so I had to convert the sample code from your tutorial.

I've got everything working nicely, except that for some reason I can only upload 32Kb. Files that are bigger only get saved for the first 32Kb.


Weird thing is that the target-variable and the writer-variable always have the exact same length as the initial content byte array, so one would expect everything went smoothly...


Do you have a clue what might be going wrong?

I'm testing this locally btw, so it aren't serverside issues. And I doubt that it has to do with my web.config since normally you're allowed to upload up to 4MB by default.


Thanks in advance!

Bart

 
 
dan
dan
RE: Files bigger than 32Kb Posted: Dec 24, 2009
 

Hi Bart,


Sure, the web.config setting has nothing to do with this uploader as the component uses web services to upload the file in chunks.  I imagine the first chunk is being transmitted but not the rest.


Firstly, are you using the same web service provided with the demo?  Does your Upload() web service method return the string "ok", this is important to ensure the uploader sends all packets of information.


Thanks!

 
 
constantine
constantine
RE: Files bigger than 32Kb Posted: Feb 19, 2010
 

Just Uncomment the bold part.


//public string Upload(string id, string mode, string path, string name, string targetname, string filedata, bool overwrite, string tag, bool final)

    public string Upload(string id, string mode, string path, string name, string filedata, bool overwrite, string tag, bool final)

    {

        string filename = string.Empty;


        if (!path.StartsWith("ClientBin/"))

        {

            return "";

        }


        name = Regex.Replace(name, "[^a-zA-Z0-9 \\-\\._!]", "");

        if (name.EndsWith(".dll") || name.EndsWith(".ascx") || name.EndsWith(".aspx"))

        {

            return "";

        }


        try

        {

            filename = Server.MapPath("~") + @"\" + path.Replace("/", @"\") + name;


            if (mode == "new")

            {

                if (File.Exists(filename) == true)

                {

                    if (overwrite)

                    {

                        File.Delete(filename);

                    }

                    else

                    {

                        return "File Already Exists";

                    }

                }


                WriteFile(filename, Convert.FromBase64String(filedata), FileMode.Create);

                //WriteFile(filename, System.Text.Encoding.UTF8.GetBytes(filedata), FileMode.Create);

                

            }

            else

            {

                WriteFile(filename, Convert.FromBase64String(filedata), FileMode.Append);

            }

        }

        catch (Exception ex)

        {

            File.Delete(filename);

            return "File Write Error: " + ex.Message;

        }


        return "ok";

    }