Latest News

  • Super Tower Defense 2 Game
    Sep 03, 2010

    New to the games section is Super Tower Defense 2. Featuring more maps, new units and bigger explosions.

  • Super Cards Online Multiplayer Game
    Aug 13, 2010

    Released today in the games section is the new Super Cards multiplayer card game. The aim of the game is to get rid of all your playing cards before your opposition.

  • Silverlight Online Chat
    Jul 24, 2010

    Today we launch the new Silverlight Live Chat application demonstrating the Liquid RichTextBox and Emoticon replacements.

  • New Super Shoot Em Up 2 Game
    Jun 29, 2010

    Added to the Games section is the new Super Shoot 'Em Up 2 game. Take control of your tank with the aim to defeat the computer controlled opponents. Features all new weapons, levels and Battle Mode!

  • Silverlight 4 Controls V5.3.2 Released
    Jun 28, 2010

    This release contains several fixes raised in the forums.

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";

    }

 
 

Rate this page: 

1 Star 2 Star 3 Star 4 Star 5 Star
8 Ratings / 2.5 Average