Results 1 to 4 of 4
Threaded View
-
29th Aug 2010, 09:09 AM #1OPMemberWebsite's:
Elite.SO Defendos.com Motionite.com[C#] File Upload + PHP - Discussion and Help
Hello, I'm new to C# so I created this thread to get help regarding this tool I was playing with
I don't need complete and working code posted here, I want help and code snippets.
This is what I want:
- File upload progress bar/dialog.
- Random file name generation.
- Dialog on upload finish, I couldn't get this working.
I already got this...
C# Code:
PHP Code:using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
namespace WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//
string a;
a = textSource.Text;
System.Net.WebClient Client = new System.Net.WebClient();
Client.Headers.Add("Content-Type", "binary/octet-stream");
byte[] result = Client.UploadFile("http://xcoderz.net/test/upload.php", "POST", @a);
string s = System.Text.Encoding.UTF8.GetString(result, 0, result.Length);
}
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "Open file...";
fdlg.InitialDirectory = @"c:\";
fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*";
fdlg.FilterIndex = 2;
fdlg.RestoreDirectory = true;
if (fdlg.ShowDialog() == DialogResult.OK)
{
textSource.Text = fdlg.FileName;
}
}
}
}
PHP Code:<?php
$uploaddir = 'upload/';
if (is_uploaded_file($_FILES['file']['tmp_name'])) {
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
echo "File ". $_FILES['file']['name'] ." uploaded successfully. ";
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
echo "OKAY!";
}
else
print_r($_FILES);
}
else {
echo "ERROR!";
print_r($_FILES);
}
?>l0calh0st Reviewed by l0calh0st on . [C#] File Upload + PHP - Discussion and Help Hello, I'm new to C# so I created this thread to get help regarding this tool I was playing with :P I don't need complete and working code posted here, I want help and code snippets. This is what I want: - File upload progress bar/dialog. - Random file name generation. - Dialog on upload finish, I couldn't get this working. I already got this... Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Monster Upload Discussion - What do you want
By monstersuppor in forum File Host DiscussionReplies: 20Last Post: 14th Oct 2012, 06:09 PM -
File$ega Discussion Thread - Post your discussions related to File$ega here.
By Merluziano in forum File Host DiscussionReplies: 3Last Post: 10th Jun 2012, 12:08 PM -
Multi-Upload.iNFO - upload your files to multiple file hosting sites
By devNULL in forum File Host DiscussionReplies: 1Last Post: 20th Jul 2011, 04:31 PM -
Discussion: File hosts overflow
By Chugi in forum File Host DiscussionReplies: 11Last Post: 18th May 2011, 10:30 PM -
filesonic not pass between them and the fileserve remote file upload to upload the ot
By uvb76 in forum File Host DiscussionReplies: 3Last Post: 28th Apr 2011, 12:28 PM
themaLeecher - leech and manage...
Version 5.05 released. Open older version (or...